{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"chapter_search_strategies.ipynb","provenance":[{"file_id":"137HAhswPSNpP45mzu7u9rnF6XHUzO71L","timestamp":1568757688910}],"collapsed_sections":[],"toc_visible":true},"kernelspec":{"name":"python3","display_name":"Python 3"}},"cells":[{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"H5Qrk7gnrucq","executionInfo":{"status":"ok","timestamp":1614449498942,"user_tz":480,"elapsed":84764,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GgIRi0T9vdv7_5OZi96H4VGhtX2CMD9asUJHPo4cQ=s64","userId":"13365523799853678553"}},"outputId":"134ecd87-e4eb-47bd-b12c-60d313685e47"},"source":["# set up graph directory\n","from google.colab import drive\n","drive.mount('/content/drive')"],"execution_count":null,"outputs":[{"output_type":"stream","text":["Mounted at /content/drive\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"FUweu2KErzxW"},"source":["# setup figure saving path\n","import os\n","import shutil\n","\n","figure_dir = 'drive/My Drive/hands-on-algorithm-source-code/figure/chapter_search_strategies'\n","if not os.path.exists(figure_dir):\n","  os.mkdir(figure_dir)     \n","!ls drive/My\\ Drive/hands-on-algorithm-source-code/figure/chapter_search_strategies"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"kHfY1ECkv6Xn"},"source":["# plot graph functions\n","from graphviz import Digraph, Graph\n","import os\n","import shutil\n","def plot_graph(v_pos, edges, graph_type, figure_dir, name = 'naive_graph'):\n","  dot = graph_type(comment=name, engine=\"neato\", format='png')\n","  for u, p in v_pos.items():\n","    dot.node(u, _attributes={'pos': str(p), 'fillcolor': \"#d62728\"})\n","  for u, v, w in edges:\n","      dot.edge(u, v, _attributes={'xlabel': str(w)})\n","  file_name = f'{name}.png'\n","  dot.render(f'test-output/{name}', view=True) \n","  shutil.copyfile(f'test-output/{name}.png', os.path.join(figure_dir, file_name)) \n","  return dot"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"Ev0G5LfkFTzu"},"source":["## Linear Search"]},{"cell_type":"code","metadata":{"id":"23e3DXOGE59o"},"source":["#Linear Search\n","def linear_search(A, t):\n","  for i, v in enumerate(A):\n","    if A[i] == t:\n","      return i\n","  return -1"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"hfcQ8BdWSO8U"},"source":["## Uninformed Search"]},{"cell_type":"code","metadata":{"id":"nRps_otMIJGX","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1614451907814,"user_tz":480,"elapsed":299,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GgIRi0T9vdv7_5OZi96H4VGhtX2CMD9asUJHPo4cQ=s64","userId":"13365523799853678553"}},"outputId":"87ef3966-6013-49fc-825b-6ac254f462b2"},"source":["## Graph Search\n","from collections import defaultdict\n","al = defaultdict(list)\n","al['S'] = [('A', 4), ('B', 5)]\n","al['A'] = [('G', 7)]\n","al['B'] = [('G', 3)]\n","al"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["defaultdict(list,\n","            {'A': [('G', 7)], 'B': [('G', 3)], 'S': [('A', 4), ('B', 5)]})"]},"metadata":{"tags":[]},"execution_count":29}]},{"cell_type":"markdown","metadata":{"id":"YT0tkaJ4SifH"},"source":["### Breath-first Search"]},{"cell_type":"code","metadata":{"id":"2yOpMY0_U-ov"},"source":["def bfs(g, s):\n","  q = [s]\n","  while q:\n","    n = q.pop(0)\n","    print(n, end = ' ')\n","    for v, _ in g[n]:\n","      q.append(v)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"LqiB-SJ8VJMg","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839678671,"user_tz":480,"elapsed":4529,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"98a4fbbf-ebef-41a2-f911-b49bc1c9b45e"},"source":["bfs(al, 'S')"],"execution_count":null,"outputs":[{"output_type":"stream","text":["S A B G G "],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"PJ2MLkuJSTf_"},"source":["### Depth-first Search\n","The completeness of DFS depends on the search space. If your search space is finite, then Depth-First Search is complete. However, if there are infinitely many alternatives, it might not find a solution. For example, suppose you were coding a path-search problem on city streets, and every time your partial path came to an intersection, you always searched the left-most street first. Then you might just keep going around the same block indefinitely.\n","\n","Sometimes there are ways to bound the search to get completeness even when the search space is unbounded. For example, for the path-search problem above, if we prune the search whenever a path returns to a previous location on the path, then DFS will always find a solution if one exists.\n","\n","There are variants of DFS that are complete. One is iterative deepening: you set a maximum search depth for DFS, and only search that far down the search tree. If you don’t find a solution, then you increase the bound and try again. (Note, however, that this method might run forever if there is no solution.)"]},{"cell_type":"code","metadata":{"id":"IH9FpE8DTce7"},"source":["# Implementation of recursive dfs\n","def dfs(g, vi):\n","  print(vi, end=' ')\n","  for v, _ in g[vi]:   \n","    dfs(g, v)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"Q9tKweIvUHFC","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839678677,"user_tz":480,"elapsed":4498,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"de3e961e-8181-4b30-ab94-dc9319a32c39"},"source":["dfs(al, 'S')"],"execution_count":null,"outputs":[{"output_type":"stream","text":["S A G B G "],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"Fikls4VUUReu"},"source":["# Implementation of iterative dfs\n","def dfs_iter(g, s):\n","  stack = [s]\n","  while stack:\n","    n = stack.pop()\n","    print(n, end = ' ')\n","    for v, _ in g[n]:\n","      stack.append(v)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"KegJMT0iUyJ3","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839678681,"user_tz":480,"elapsed":4456,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"287815f2-1fbf-4b4c-cd84-4ca905d3b616"},"source":["dfs_iter(al, 'S')"],"execution_count":null,"outputs":[{"output_type":"stream","text":["S B G A G "],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"yZ3viz03H4EJ"},"source":["### Uniform-Cost Search"]},{"cell_type":"markdown","metadata":{"id":"fdT2z_NrLKJP"},"source":["```\n","q = [(0, S)]\n","Expand S, add A and B\n","q = [(4, A), (5, B)]\n","Expand A, add G\n","q = [(5, B), (11, G)]\n","Expand B, add G\n","q = [(8, G), (11, G)]\n","Expand G, goal found, terminate.\n","```"]},{"cell_type":"code","metadata":{"id":"ZhCNgx-rKzHq"},"source":["import heapq\n","def ucs(graph, s, t):\n","  q = [(0, s)] # initial path with cost 0\n","  while q:\n","    cost, n = heapq.heappop(q)\n","    # Need to check when goal is removed from the priority queue\n","    if n == t:\n","      return cost\n","    else:\n","      for v, c in graph[n]:\n","        heapq.heappush(q, (c + cost, v))\n","  return None"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"QQb89fDwMm6V","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839678686,"user_tz":480,"elapsed":4412,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"e0d318db-87b2-4200-a1f4-07e2d6c12820"},"source":["ucs(al, s='A', t='G')"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["7"]},"metadata":{"tags":[]},"execution_count":487}]},{"cell_type":"markdown","metadata":{"id":"mahGDvIKNs0k"},"source":["### Iterative-Deepening Search (IDS)\n"]},{"cell_type":"code","metadata":{"id":"MoPms3bOSbIK"},"source":["# Depth limited Search\n","def dls(graph, cur, t, maxDepth):\n","  # End Condition\n","  if maxDepth == 0:\n","    print('test: ', cur, end = ' ')\n","    if cur == t:\n","      return True\n","  if maxDepth < 0:\n","    return False\n","\n","  # Recur for adjacent vertices\n","  for n, _ in graph[cur]:\n","    if dls(graph, n, t, maxDepth - 1):\n","      return True\n","  return False"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"5D25vnOVN2H5"},"source":["# Iterative-deepening search\n","def ids(graph, s, t, maxDepth):\n","  for i in range(maxDepth):\n","    print('depth:', i)\n","    if dls(graph, s, t, i):\n","      return True\n","    print('\\n')\n","  return False\n","    "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"PPUE1EfrTff0","colab":{"base_uri":"https://localhost:8080/","height":156},"executionInfo":{"status":"ok","timestamp":1577839678693,"user_tz":480,"elapsed":4375,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"083f0c90-ab80-4a10-e331-efad578966d7"},"source":["# Find 'B'\n","ids(al, 'S', 'G', 3)"],"execution_count":null,"outputs":[{"output_type":"stream","text":["depth: 0\n","test:  S \n","\n","depth: 1\n","test:  A test:  B \n","\n","depth: 2\n","test:  G "],"name":"stdout"},{"output_type":"execute_result","data":{"text/plain":["True"]},"metadata":{"tags":[]},"execution_count":490}]},{"cell_type":"markdown","metadata":{"id":"84kFFfrjHxH7"},"source":["### Bidirectional Search"]},{"cell_type":"code","metadata":{"id":"g7NGJLqrH1AM"},"source":["def bfs_level(graph, q, bStep):\n","  '''\n","  q: set for better efficiency in intersection checking\n","  '''\n","  if not bStep:\n","    return q\n","  nq = set()\n","  for n in q:\n","    for v, c in graph[n]:\n","      nq.add(v)\n","  return nq\n","\n","def intersect(qs, qt):\n","  if qs & qt: # intersection \n","    return True\n","  return False"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"6a9IpOExIXXm"},"source":["def bis(graph, s, t):\n","  # First build a graph with opposite edges \n","  bgraph = defaultdict(list)\n","  for key, value in graph.items():\n","    for n, c in value:\n","      bgraph[n].append((key, c))\n","  print(graph, bgraph)\n","  # Start bidirectional search\n","  qs = {s}\n","  qt = {t}\n","  step = 0\n","  while qs and qt:\n","    print(qs, qt)\n","    if intersect(qs, qt):\n","      return True\n","    qs = bfs_level(graph, qs, step%2 == 0)\n","    qt = bfs_level(bgraph, qt, step%2 == 1)\n","    step = 1 - step\n","  return False\n"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"nrZW4C9_K37z","colab":{"base_uri":"https://localhost:8080/","height":106},"executionInfo":{"status":"ok","timestamp":1577839678698,"user_tz":480,"elapsed":4337,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"56c325a2-63a9-4247-ba7e-87e461bf896c"},"source":["bis(al, 'S', 'A')"],"execution_count":null,"outputs":[{"output_type":"stream","text":["defaultdict(<class 'list'>, {'S': [('A', 4), ('B', 5)], 'A': [('G', 7)], 'B': [('G', 3)], 'G': []}) defaultdict(<class 'list'>, {'A': [('S', 4)], 'B': [('S', 5)], 'G': [('A', 7), ('B', 3)]})\n","{'S'} {'A'}\n","{'B', 'A'} {'A'}\n"],"name":"stdout"},{"output_type":"execute_result","data":{"text/plain":["True"]},"metadata":{"tags":[]},"execution_count":493}]},{"cell_type":"markdown","metadata":{"id":"ByphOhrKZtMj"},"source":["## Graph Search"]},{"cell_type":"code","metadata":{"id":"E7ZgUDIIaSaD","colab":{"base_uri":"https://localhost:8080/","height":465},"executionInfo":{"status":"ok","timestamp":1577839678700,"user_tz":480,"elapsed":4318,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"b4b4bbaa-2199-4415-b31e-28eda9b623bf"},"source":["from graphviz import Digraph, Graph\n","dot = Digraph(comment='The Round Table', format='png')\n","#print(get_methods(Digraph))\n","#print(Digraph.__dict__)\n","nodes = [0, 1, 2, 3, 4, 5]\n","for node in nodes:\n","  dot.node(str(node))\n","dot.edges(['01','12', '24', '43', '45'])\n","dot.render('test-output/free_tree', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b6345eda0>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"134pt\" height=\"332pt\"\n viewBox=\"0.00 0.00 134.00 332.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 328)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-328 130,-328 130,4 -4,4\"/>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-306\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M63,-287.8314C63,-280.131 63,-270.9743 63,-262.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"66.5001,-262.4132 63,-252.4133 59.5001,-262.4133 66.5001,-262.4132\"/>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 1&#45;&gt;2 -->\n<g id=\"edge2\" class=\"edge\">\n<title>1&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M63,-215.8314C63,-208.131 63,-198.9743 63,-190.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"66.5001,-190.4132 63,-180.4133 59.5001,-190.4133 66.5001,-190.4132\"/>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge3\" class=\"edge\">\n<title>2&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M63,-143.8314C63,-136.131 63,-126.9743 63,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"66.5001,-118.4132 63,-108.4133 59.5001,-118.4133 66.5001,-118.4132\"/>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 4&#45;&gt;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>4&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54.2854,-72.5708C50.0403,-64.0807 44.8464,-53.6929 40.1337,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"43.237,-42.6477 35.6343,-35.2687 36.976,-45.7782 43.237,-42.6477\"/>\n</g>\n<!-- 5 -->\n<g id=\"node6\" class=\"node\">\n<title>5</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 4&#45;&gt;5 -->\n<g id=\"edge5\" class=\"edge\">\n<title>4&#45;&gt;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M71.7146,-72.5708C75.9597,-64.0807 81.1536,-53.6929 85.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"89.024,-45.7782 90.3657,-35.2687 82.763,-42.6477 89.024,-45.7782\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":494}]},{"cell_type":"code","metadata":{"id":"-5v2VZ8bImzM","colab":{"base_uri":"https://localhost:8080/","height":369},"executionInfo":{"status":"ok","timestamp":1577839678702,"user_tz":480,"elapsed":4303,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"eb70eca0-d48b-45c6-9141-b8685859e244"},"source":["dot = Graph(comment='The Round Table', format='png')\n","#print(get_methods(Digraph))\n","#print(Digraph.__dict__)\n","nodes = [0, 1, 2, 3, 4, 5]\n","# for node in nodes:\n","#   dot.node(str(node))\n","dot.edges(['01','02', '12','13', '24','34', '45'])\n","rank1 = [0]\n","rank2 = [1, 2]\n","rank3 = [3, 4]\n","rank4 = [5]\n","for rank in [rank1, rank2, rank3, rank4]:\n","  with dot.subgraph() as s:\n","    s.attr(rank='same')\n","    for node in rank:\n","      s.node(str(node))\n","dot.render('test-output/undirected_cyclic_graph', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Graph at 0x7f6b634b9630>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"134pt\" height=\"260pt\"\n viewBox=\"0.00 0.00 134.00 260.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 256)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-256 130,-256 130,4 -4,4\"/>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 0&#45;&#45;1 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0&#45;&#45;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54.2854,-216.5708C48.6253,-205.2506 41.2784,-190.5568 35.6343,-179.2687\"/>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 0&#45;&#45;2 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0&#45;&#45;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M71.7146,-216.5708C77.3747,-205.2506 84.7216,-190.5568 90.3657,-179.2687\"/>\n</g>\n<!-- 1&#45;&#45;2 -->\n<g id=\"edge3\" class=\"edge\">\n<title>1&#45;&#45;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-162C59.9766,-162 65.9531,-162 71.9297,-162\"/>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 1&#45;&#45;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>1&#45;&#45;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M27,-143.8314C27,-133 27,-119.2876 27,-108.4133\"/>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 2&#45;&#45;4 -->\n<g id=\"edge5\" class=\"edge\">\n<title>2&#45;&#45;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M99,-143.8314C99,-133 99,-119.2876 99,-108.4133\"/>\n</g>\n<!-- 3&#45;&#45;4 -->\n<g id=\"edge6\" class=\"edge\">\n<title>3&#45;&#45;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-90C59.9766,-90 65.9531,-90 71.9297,-90\"/>\n</g>\n<!-- 5 -->\n<g id=\"node6\" class=\"node\">\n<title>5</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 4&#45;&#45;5 -->\n<g id=\"edge7\" class=\"edge\">\n<title>4&#45;&#45;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M99,-71.8314C99,-61 99,-47.2876 99,-36.4133\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":495}]},{"cell_type":"code","metadata":{"id":"cI2CmyM-eGna","colab":{"base_uri":"https://localhost:8080/","height":369},"executionInfo":{"status":"ok","timestamp":1577839678705,"user_tz":480,"elapsed":4289,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"f5f64c50-7e20-403c-a32a-36db75db2f52"},"source":["dot = Digraph(comment='The Round Table', format='png')\n","#print(get_methods(Digraph))\n","#print(Digraph.__dict__)\n","nodes = [0, 1, 2, 3, 4, 5]\n","# for node in nodes:\n","#   dot.node(str(node))\n","dot.edges(['01', '12','31', '20', '24','43', '45'])\n","rank1 = [0]\n","rank2 = [1, 2]\n","rank3 = [3, 4]\n","rank4 = [5]\n","for rank in [rank1, rank2, rank3, rank4]:\n","  with dot.subgraph() as s:\n","    s.attr(rank='same')\n","    for node in rank:\n","      s.node(str(node))\n","dot.render('test-output/directed_cyclic_graph', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b63488048>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"134pt\" height=\"260pt\"\n viewBox=\"0.00 0.00 134.00 260.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 256)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-256 130,-256 130,4 -4,4\"/>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54.2854,-216.5708C50.0403,-208.0807 44.8464,-197.6929 40.1337,-188.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"43.237,-186.6477 35.6343,-179.2687 36.976,-189.7782 43.237,-186.6477\"/>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 1&#45;&gt;2 -->\n<g id=\"edge2\" class=\"edge\">\n<title>1&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-162C56.6147,-162 59.2295,-162 61.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-165.5001 71.9297,-162 61.9297,-158.5001 61.9297,-165.5001\"/>\n</g>\n<!-- 2&#45;&gt;0 -->\n<g id=\"edge4\" class=\"edge\">\n<title>2&#45;&gt;0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M90.3657,-179.2687C86.1326,-187.7348 80.9417,-198.1166 76.223,-207.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"73.0563,-206.0613 71.7146,-216.5708 79.3173,-209.1918 73.0563,-206.0613\"/>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge5\" class=\"edge\">\n<title>2&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-146.7307C73.803,-136.803 60.6847,-123.6847 49.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-109.8436 42.2473,-105.2473 46.8436,-114.7933 51.7933,-109.8436\"/>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 3&#45;&gt;1 -->\n<g id=\"edge3\" class=\"edge\">\n<title>3&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7527,-105.2473C73.8297,-115.1703 60.7123,-128.2877 49.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"46.8656,-137.1847 42.2693,-146.7307 51.8153,-142.1344 46.8656,-137.1847\"/>\n</g>\n<!-- 4&#45;&gt;3 -->\n<g id=\"edge6\" class=\"edge\">\n<title>4&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-90C56.6147,-90 59.2295,-90 61.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-93.5001 71.9297,-90 61.9297,-86.5001 61.9297,-93.5001\"/>\n</g>\n<!-- 5 -->\n<g id=\"node6\" class=\"node\">\n<title>5</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 4&#45;&gt;5 -->\n<g id=\"edge7\" class=\"edge\">\n<title>4&#45;&gt;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M27,-71.8314C27,-64.131 27,-54.9743 27,-46.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"30.5001,-46.4132 27,-36.4133 23.5001,-46.4133 30.5001,-46.4132\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":496}]},{"cell_type":"code","metadata":{"id":"2K9nipQJff_F"},"source":["# Prepare Graph Example\n","# Adjacency List with cycle\n","ft = [[] for _ in range(6)]\n","ft[0] = [1]\n","ft[1] = [2]\n","ft[2] = [4]\n","ft[4] = [3, 5]\n","ft[5] = []"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"ajKsBPhBgQcN"},"source":["# directed cyclc graph\n","dcg = [[] for _ in range(6)]\n","dcg[0] = [1]\n","dcg[1] = [2]\n","dcg[2] = [0, 4]\n","dcg[3] = [1]\n","dcg[4] = [3, 5]\n","dcg[5] = []"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"0385JGxBPGWl"},"source":["# Prepare Graph Example\n","# Adjacency List with cycle\n","ucg = [[] for _ in range(6)]\n","ucg[0] = [1, 2]\n","ucg[1] = [0, 2, 3]\n","ucg[2] = [0, 1,  4]\n","ucg[3] = [1, 4]\n","ucg[4] = [2, 3, 5]\n","ucg[5] = [4]"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"E_EBbni8WYoB"},"source":["#STATE Class\n","class STATE:\n","    white = 0\n","    gray = 1\n","    black = 2"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"fjb4NQ4QGRIu"},"source":["### Depth-first Search in Graph"]},{"cell_type":"markdown","metadata":{"id":"7O4uRkjzouHz"},"source":["#### Track Paths and Avoid Cycle in the tree-based search"]},{"cell_type":"code","metadata":{"id":"BnwTjoskRGm0"},"source":["#Free Tree Search\n","def dfs(g, vi):\n","  print(vi, end=' ')\n","  for nv in g[vi]:   \n","    dfs(g, nv)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"oo4bQGakSble","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839678718,"user_tz":480,"elapsed":4228,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"7491e818-5a1c-4c48-a95c-9901eb5a2edc"},"source":["dfs(ft, 0)"],"execution_count":null,"outputs":[{"output_type":"stream","text":["0 1 2 4 3 5 "],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"CpnZbW1nUV5v"},"source":["# Failed with directed cyclic graph\n","# dfs(dcg, 0)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"95BRIU3VlyAb"},"source":["#Graph Search, track paths and avoids cycle\n","def dfs(g, vi, path):\n","  paths.append(path)\n","  orders.append(vi)\n","  for nv in g[vi]:  \n","    if nv not in path: \n","      dfs(g, nv, path+[nv])\n","  return "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"LjXfmd17mKAi","colab":{"base_uri":"https://localhost:8080/","height":52},"executionInfo":{"status":"ok","timestamp":1577839680383,"user_tz":480,"elapsed":5860,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"8526d563-8e86-4508-84c2-c9b4cf393cec"},"source":["# Test free tree\n","paths, orders = [], []\n","dfs(ft, 0, [0])\n","paths, orders"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0], [0, 1], [0, 1, 2], [0, 1, 2, 4], [0, 1, 2, 4, 3], [0, 1, 2, 4, 5]],\n"," [0, 1, 2, 4, 3, 5])"]},"metadata":{"tags":[]},"execution_count":505}]},{"cell_type":"code","metadata":{"id":"Ki0HtnO8mgD4","colab":{"base_uri":"https://localhost:8080/","height":52},"executionInfo":{"status":"ok","timestamp":1577839680386,"user_tz":480,"elapsed":5850,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"546bd0ca-41ca-413d-923c-7ec57f1f8a05"},"source":["# Test dcg\n","paths, orders = [], []\n","dfs(dcg, 0, [0])\n","paths, orders"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0], [0, 1], [0, 1, 2], [0, 1, 2, 4], [0, 1, 2, 4, 3], [0, 1, 2, 4, 5]],\n"," [0, 1, 2, 4, 3, 5])"]},"metadata":{"tags":[]},"execution_count":506}]},{"cell_type":"code","metadata":{"id":"nARQsx-3nlGd","colab":{"base_uri":"https://localhost:8080/","height":364},"executionInfo":{"status":"ok","timestamp":1577839680387,"user_tz":480,"elapsed":5835,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"fe99a308-04d7-44ab-80f7-e0b90cb91f33"},"source":["# Test ucg\n","paths, orders = [], []\n","dfs(ucg, 0, [0])\n","paths, orders"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0],\n","  [0, 1],\n","  [0, 1, 2],\n","  [0, 1, 2, 4],\n","  [0, 1, 2, 4, 3],\n","  [0, 1, 2, 4, 5],\n","  [0, 1, 3],\n","  [0, 1, 3, 4],\n","  [0, 1, 3, 4, 2],\n","  [0, 1, 3, 4, 5],\n","  [0, 2],\n","  [0, 2, 1],\n","  [0, 2, 1, 3],\n","  [0, 2, 1, 3, 4],\n","  [0, 2, 1, 3, 4, 5],\n","  [0, 2, 4],\n","  [0, 2, 4, 3],\n","  [0, 2, 4, 3, 1],\n","  [0, 2, 4, 5]],\n"," [0, 1, 2, 4, 3, 5, 3, 4, 2, 5, 2, 1, 3, 4, 5, 4, 3, 1, 5])"]},"metadata":{"tags":[]},"execution_count":507}]},{"cell_type":"markdown","metadata":{"id":"ZVhNQx4DgDe6"},"source":["Draw the search tree"]},{"cell_type":"code","metadata":{"id":"mSYmoZ_0gG4B"},"source":["# Only keep the longest path\n","def dfs_helper(g, vi, path):\n","  orders.append(vi)\n","  bpath = True\n","  for nv in g[vi]:  \n","    if nv not in path: \n","      dfs_helper(g, nv, path+[nv])\n","      bpath = False\n","  if bpath:\n","    paths.append(path)\n","  return "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"C0wF99z6huEu","colab":{"base_uri":"https://localhost:8080/","height":156},"executionInfo":{"status":"ok","timestamp":1577839680388,"user_tz":480,"elapsed":5814,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"96f8adfa-b67d-4751-9fc1-44648993cb49"},"source":["paths, orders = [], []\n","dfs_helper(ucg, 0, [0])\n","paths, orders"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0, 1, 2, 4, 3],\n","  [0, 1, 2, 4, 5],\n","  [0, 1, 3, 4, 2],\n","  [0, 1, 3, 4, 5],\n","  [0, 2, 1, 3, 4, 5],\n","  [0, 2, 4, 3, 1],\n","  [0, 2, 4, 5]],\n"," [0, 1, 2, 4, 3, 5, 3, 4, 2, 5, 2, 1, 3, 4, 5, 4, 3, 1, 5])"]},"metadata":{"tags":[]},"execution_count":509}]},{"cell_type":"code","metadata":{"id":"4TVSieudlvH3"},"source":["# Track edges\n","def dfs_helper(g, vi, path):\n","  orders.append(vi)\n","  node = (vi, 0)\n","  if vi in tracker:\n","    node = (vi, tracker[vi] + 1)\n","    tracker[vi] += 1\n","  else:\n","    tracker[vi] = 0\n","  for nv in g[vi]:  \n","    if nv not in path: \n","      # add an edge\n","      node1 = (nv, 0)\n","      if nv in tracker:\n","        node1 = (nv, tracker[nv]+1)\n","      edges[node].append(node1)\n","      dfs_helper(g, nv, path+[nv]) \n","  return "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"WwGSwE4PnRbB","colab":{"base_uri":"https://localhost:8080/","height":312},"executionInfo":{"status":"ok","timestamp":1577839680391,"user_tz":480,"elapsed":5789,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"1dffc8ad-fa7e-4694-ea51-ad50d18cd0e6"},"source":["paths, orders = [], []\n","tracker = defaultdict(int) # node: maximum count\n","edges = defaultdict(list) # node: node\n","dfs_helper(ucg, 0, [0])\n","paths, orders, edges, tracker, len(orders)"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([],\n"," [0, 1, 2, 4, 3, 5, 3, 4, 2, 5, 2, 1, 3, 4, 5, 4, 3, 1, 5],\n"," defaultdict(list,\n","             {(0, 0): [(1, 0), (2, 2)],\n","              (1, 0): [(2, 0), (3, 1)],\n","              (1, 1): [(3, 2)],\n","              (2, 0): [(4, 0)],\n","              (2, 2): [(1, 1), (4, 3)],\n","              (3, 1): [(4, 1)],\n","              (3, 2): [(4, 2)],\n","              (3, 3): [(1, 2)],\n","              (4, 0): [(3, 0), (5, 0)],\n","              (4, 1): [(2, 1), (5, 1)],\n","              (4, 2): [(5, 2)],\n","              (4, 3): [(3, 3), (5, 3)]}),\n"," defaultdict(int, {0: 0, 1: 2, 2: 2, 3: 3, 4: 3, 5: 3}),\n"," 19)"]},"metadata":{"tags":[]},"execution_count":511}]},{"cell_type":"code","metadata":{"id":"s8Ti-Bo-ic0J","colab":{"base_uri":"https://localhost:8080/","height":561},"executionInfo":{"status":"ok","timestamp":1577839680393,"user_tz":480,"elapsed":5774,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"bbdb4d18-1cc1-426e-ef12-168ecdefd045"},"source":["# Plot the search tree\n","dot = Digraph(comment='The Round Table', format='png')\n","#print(get_methods(Digraph))\n","#print(Digraph.__dict__)\n","nodes = [0, 1, 2, 3, 4, 5]\n","for node, count in tracker.items():\n","  for i in range(count+1):\n","    name=str(node)+str(i)\n","    label=str(node)\n","    #print(name, label)\n","    dot.node(name=str(node)+str(i), label=str(node))\n","for node1, nlist in edges.items():\n","  for node2 in nlist:\n","    a = str(node1[0])+str(node1[1])\n","    b = str(node2[0])+str(node2[1])\n","    #print(a, b)\n","    dot.edge(a, b)\n","#dot.edges(['01', '12','31', '20', '24','43', '45'])\n","dot.render('test-output/search_tree_dfs', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b63488da0>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"494pt\" height=\"404pt\"\n viewBox=\"0.00 0.00 494.00 404.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 400)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-400 490,-400 490,4 -4,4\"/>\n<!-- 00 -->\n<g id=\"node1\" class=\"node\">\n<title>00</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"279\" cy=\"-378\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"279\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 10 -->\n<g id=\"node2\" class=\"node\">\n<title>10</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"207\" cy=\"-306\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"207\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 00&#45;&gt;10 -->\n<g id=\"edge1\" class=\"edge\">\n<title>00&#45;&gt;10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M263.7307,-362.7307C253.803,-352.803 240.6847,-339.6847 229.5637,-328.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"231.7933,-325.8436 222.2473,-321.2473 226.8436,-330.7933 231.7933,-325.8436\"/>\n</g>\n<!-- 22 -->\n<g id=\"node7\" class=\"node\">\n<title>22</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"315\" cy=\"-306\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 00&#45;&gt;22 -->\n<g id=\"edge2\" class=\"edge\">\n<title>00&#45;&gt;22</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M287.7146,-360.5708C291.9597,-352.0807 297.1536,-341.6929 301.8663,-332.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"305.024,-333.7782 306.3657,-323.2687 298.763,-330.6477 305.024,-333.7782\"/>\n</g>\n<!-- 20 -->\n<g id=\"node5\" class=\"node\">\n<title>20</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"135\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"135\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 10&#45;&gt;20 -->\n<g id=\"edge3\" class=\"edge\">\n<title>10&#45;&gt;20</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M191.7307,-290.7307C181.803,-280.803 168.6847,-267.6847 157.5637,-256.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"159.7933,-253.8436 150.2473,-249.2473 154.8436,-258.7933 159.7933,-253.8436\"/>\n</g>\n<!-- 31 -->\n<g id=\"node13\" class=\"node\">\n<title>31</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"207\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"207\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 10&#45;&gt;31 -->\n<g id=\"edge4\" class=\"edge\">\n<title>10&#45;&gt;31</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M207,-287.8314C207,-280.131 207,-270.9743 207,-262.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"210.5001,-262.4132 207,-252.4133 203.5001,-262.4133 210.5001,-262.4132\"/>\n</g>\n<!-- 11 -->\n<g id=\"node3\" class=\"node\">\n<title>11</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"315\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 32 -->\n<g id=\"node14\" class=\"node\">\n<title>32</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"315\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 11&#45;&gt;32 -->\n<g id=\"edge13\" class=\"edge\">\n<title>11&#45;&gt;32</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M315,-215.8314C315,-208.131 315,-198.9743 315,-190.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"318.5001,-190.4132 315,-180.4133 311.5001,-190.4133 318.5001,-190.4132\"/>\n</g>\n<!-- 12 -->\n<g id=\"node4\" class=\"node\">\n<title>12</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"387\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 40 -->\n<g id=\"node8\" class=\"node\">\n<title>40</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 20&#45;&gt;40 -->\n<g id=\"edge5\" class=\"edge\">\n<title>20&#45;&gt;40</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M126.2854,-216.5708C122.0403,-208.0807 116.8464,-197.6929 112.1337,-188.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"115.237,-186.6477 107.6343,-179.2687 108.976,-189.7782 115.237,-186.6477\"/>\n</g>\n<!-- 21 -->\n<g id=\"node6\" class=\"node\">\n<title>21</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"171\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"171\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 22&#45;&gt;11 -->\n<g id=\"edge11\" class=\"edge\">\n<title>22&#45;&gt;11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M315,-287.8314C315,-280.131 315,-270.9743 315,-262.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"318.5001,-262.4132 315,-252.4133 311.5001,-262.4133 318.5001,-262.4132\"/>\n</g>\n<!-- 43 -->\n<g id=\"node11\" class=\"node\">\n<title>43</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"387\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 22&#45;&gt;43 -->\n<g id=\"edge12\" class=\"edge\">\n<title>22&#45;&gt;43</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M330.2693,-290.7307C340.197,-280.803 353.3153,-267.6847 364.4363,-256.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"367.1564,-258.7933 371.7527,-249.2473 362.2067,-253.8436 367.1564,-258.7933\"/>\n</g>\n<!-- 30 -->\n<g id=\"node12\" class=\"node\">\n<title>30</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 40&#45;&gt;30 -->\n<g id=\"edge6\" class=\"edge\">\n<title>40&#45;&gt;30</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-146.7307C73.803,-136.803 60.6847,-123.6847 49.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-109.8436 42.2473,-105.2473 46.8436,-114.7933 51.7933,-109.8436\"/>\n</g>\n<!-- 50 -->\n<g id=\"node16\" class=\"node\">\n<title>50</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 40&#45;&gt;50 -->\n<g id=\"edge7\" class=\"edge\">\n<title>40&#45;&gt;50</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M99,-143.8314C99,-136.131 99,-126.9743 99,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"102.5001,-118.4132 99,-108.4133 95.5001,-118.4133 102.5001,-118.4132\"/>\n</g>\n<!-- 41 -->\n<g id=\"node9\" class=\"node\">\n<title>41</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"207\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"207\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 41&#45;&gt;21 -->\n<g id=\"edge9\" class=\"edge\">\n<title>41&#45;&gt;21</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M198.2854,-144.5708C194.0403,-136.0807 188.8464,-125.6929 184.1337,-116.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"187.237,-114.6477 179.6343,-107.2687 180.976,-117.7782 187.237,-114.6477\"/>\n</g>\n<!-- 51 -->\n<g id=\"node17\" class=\"node\">\n<title>51</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"243\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"243\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 41&#45;&gt;51 -->\n<g id=\"edge10\" class=\"edge\">\n<title>41&#45;&gt;51</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M215.7146,-144.5708C219.9597,-136.0807 225.1536,-125.6929 229.8663,-116.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"233.024,-117.7782 234.3657,-107.2687 226.763,-114.6477 233.024,-117.7782\"/>\n</g>\n<!-- 42 -->\n<g id=\"node10\" class=\"node\">\n<title>42</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"315\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 52 -->\n<g id=\"node18\" class=\"node\">\n<title>52</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"315\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 42&#45;&gt;52 -->\n<g id=\"edge15\" class=\"edge\">\n<title>42&#45;&gt;52</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M315,-71.8314C315,-64.131 315,-54.9743 315,-46.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"318.5001,-46.4132 315,-36.4133 311.5001,-46.4133 318.5001,-46.4132\"/>\n</g>\n<!-- 33 -->\n<g id=\"node15\" class=\"node\">\n<title>33</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"387\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 43&#45;&gt;33 -->\n<g id=\"edge16\" class=\"edge\">\n<title>43&#45;&gt;33</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M387,-215.8314C387,-208.131 387,-198.9743 387,-190.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"390.5001,-190.4132 387,-180.4133 383.5001,-190.4133 390.5001,-190.4132\"/>\n</g>\n<!-- 53 -->\n<g id=\"node19\" class=\"node\">\n<title>53</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"459\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"459\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 43&#45;&gt;53 -->\n<g id=\"edge17\" class=\"edge\">\n<title>43&#45;&gt;53</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M402.2693,-218.7307C412.197,-208.803 425.3153,-195.6847 436.4363,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"439.1564,-186.7933 443.7527,-177.2473 434.2067,-181.8436 439.1564,-186.7933\"/>\n</g>\n<!-- 31&#45;&gt;41 -->\n<g id=\"edge8\" class=\"edge\">\n<title>31&#45;&gt;41</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M207,-215.8314C207,-208.131 207,-198.9743 207,-190.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"210.5001,-190.4132 207,-180.4133 203.5001,-190.4133 210.5001,-190.4132\"/>\n</g>\n<!-- 32&#45;&gt;42 -->\n<g id=\"edge14\" class=\"edge\">\n<title>32&#45;&gt;42</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M315,-143.8314C315,-136.131 315,-126.9743 315,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"318.5001,-118.4132 315,-108.4133 311.5001,-118.4133 318.5001,-118.4132\"/>\n</g>\n<!-- 33&#45;&gt;12 -->\n<g id=\"edge18\" class=\"edge\">\n<title>33&#45;&gt;12</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M387,-143.8314C387,-136.131 387,-126.9743 387,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"390.5001,-118.4132 387,-108.4133 383.5001,-118.4133 390.5001,-118.4132\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":512}]},{"cell_type":"markdown","metadata":{"id":"ZD5tQSWFoVOK"},"source":["We can see as the edges in the directed graph increase, the search tree explode exponentially with the number of edges. "]},{"cell_type":"code","metadata":{"id":"yCuIaMa4c-Cl"},"source":["#Graph Search, track paths and avoids cycle\n","def recursive(g, vi, path):\n","  '''\n","  g: graph as an adjacency list\n","  vi: the vertex index\n","  '''\n","  #print(vi, end=' ')\n","  paths, nodes = [[]], []\n","  for nv in g[vi]:  \n","    if nv not in path: \n","      spaths, snodes = recursive(g, nv, path+[nv])\n","      paths.extend(spaths)\n","      nodes.extend(snodes)\n","  paths = [[vi] + p for p in paths]\n","  return paths, [vi] + nodes\n","  "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"FUkmQgjndWkn","colab":{"base_uri":"https://localhost:8080/","height":364},"executionInfo":{"status":"ok","timestamp":1577839680396,"user_tz":480,"elapsed":5751,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"d10feafd-209b-43fd-c43d-fd9f5ef00fd6"},"source":["# print path with free tree\n","recursive(ucg, 0, [0])\n"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0],\n","  [0, 1],\n","  [0, 1, 2],\n","  [0, 1, 2, 4],\n","  [0, 1, 2, 4, 3],\n","  [0, 1, 2, 4, 5],\n","  [0, 1, 3],\n","  [0, 1, 3, 4],\n","  [0, 1, 3, 4, 2],\n","  [0, 1, 3, 4, 5],\n","  [0, 2],\n","  [0, 2, 1],\n","  [0, 2, 1, 3],\n","  [0, 2, 1, 3, 4],\n","  [0, 2, 1, 3, 4, 5],\n","  [0, 2, 4],\n","  [0, 2, 4, 3],\n","  [0, 2, 4, 3, 1],\n","  [0, 2, 4, 5]],\n"," [0, 1, 2, 4, 3, 5, 3, 4, 2, 5, 2, 1, 3, 4, 5, 4, 3, 1, 5])"]},"metadata":{"tags":[]},"execution_count":514}]},{"cell_type":"markdown","metadata":{"id":"qG_4NLC-o4bn"},"source":["#### Graph-based Search that avoids repeating vertex"]},{"cell_type":"code","metadata":{"id":"NTH_S5wQi_Lf"},"source":["#Avoid Repeating Vertex\n","def dfgs(g, vi, visited, path):\n","  visited.add(vi)\n","  orders.append(vi)\n","  bEnd = True # node without unvisited adjacent nodes    \n","  for nv in g[vi]:  \n","    if nv not in visited: \n","      if bEnd:\n","        bEnd = False\n","      dfgs(g, nv, visited, path + [nv])\n","  if bEnd:\n","    paths.append(path)"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"037PpuQvjMTj","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839680399,"user_tz":480,"elapsed":5730,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"0f8982ed-76ef-4e3d-faf6-2b317cd6aa15"},"source":["paths, orders = [], []\n","dfgs(ucg, 0, set(), [0])\n","paths, orders"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0, 1, 2, 4, 3], [0, 1, 2, 4, 5]], [0, 1, 2, 4, 3, 5])"]},"metadata":{"tags":[]},"execution_count":516}]},{"cell_type":"code","metadata":{"id":"vn-U1OFJof4B"},"source":["def backtrace(parent, s, t):\n","  p = t\n","  path = []\n","  while p != s:\n","    path.append(p)\n","    p = parent[p]\n","  path.append(s)\n","  return path[::-1]"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"1aN6kwYPoH5d"},"source":["# Backtrace path\n","# s is used to backtrace the path\n","def dfgs(g, vi, s, t, visited, parent):  \n","  visited.add(vi) \n","  if vi == t:\n","    return backtrace(parent, s, t)\n","\n","  for nv in g[vi]:  \n","    if nv not in visited: \n","      parent[nv] = vi\n","      fpath = dfgs(g, nv, s, t, visited, parent)\n","      if fpath:\n","        return fpath\n","  \n","  return None"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"_dGSXhR2phQh","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839680403,"user_tz":480,"elapsed":5702,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"2800b185-daae-46d1-c7d8-7d115fcece60"},"source":["parent = {}\n","path = dfgs(ucg, 0, 0, None, set(),  parent)\n","path, parent"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(None, {1: 0, 2: 1, 3: 4, 4: 2, 5: 4})"]},"metadata":{"tags":[]},"execution_count":519}]},{"cell_type":"code","metadata":{"id":"TXjsA5BRLx87","colab":{"base_uri":"https://localhost:8080/","height":465},"executionInfo":{"status":"ok","timestamp":1577839680404,"user_tz":480,"elapsed":5688,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"b30b4b1f-73fc-4e38-8939-6c8c2b6d61ac"},"source":["# Visualize the search tree\n","dot = Digraph(comment='The Round Table', format='png')\n","#print(get_methods(Digraph))\n","#print(Digraph.__dict__)\n","nodes = [0, 1, 2, 3, 4, 5]\n","for node in nodes:\n","    dot.node(name=str(node))\n","for s, p in parent.items():\n","    dot.edge(str(p), str(s))\n","#dot.edges(['01', '12','31', '20', '24','43', '45'])\n","dot.render('test-output/depth_first_graph_search_tree', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b6346b0b8>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"134pt\" height=\"332pt\"\n viewBox=\"0.00 0.00 134.00 332.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 328)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-328 130,-328 130,4 -4,4\"/>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-306\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-302.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M63,-287.8314C63,-280.131 63,-270.9743 63,-262.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"66.5001,-262.4132 63,-252.4133 59.5001,-262.4133 66.5001,-262.4132\"/>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 1&#45;&gt;2 -->\n<g id=\"edge2\" class=\"edge\">\n<title>1&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M63,-215.8314C63,-208.131 63,-198.9743 63,-190.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"66.5001,-190.4132 63,-180.4133 59.5001,-190.4133 66.5001,-190.4132\"/>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge3\" class=\"edge\">\n<title>2&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M63,-143.8314C63,-136.131 63,-126.9743 63,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"66.5001,-118.4132 63,-108.4133 59.5001,-118.4133 66.5001,-118.4132\"/>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 4&#45;&gt;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>4&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54.2854,-72.5708C50.0403,-64.0807 44.8464,-53.6929 40.1337,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"43.237,-42.6477 35.6343,-35.2687 36.976,-45.7782 43.237,-42.6477\"/>\n</g>\n<!-- 5 -->\n<g id=\"node6\" class=\"node\">\n<title>5</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 4&#45;&gt;5 -->\n<g id=\"edge5\" class=\"edge\">\n<title>4&#45;&gt;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M71.7146,-72.5708C75.9597,-64.0807 81.1536,-53.6929 85.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"89.024,-45.7782 90.3657,-35.2687 82.763,-42.6477 89.024,-45.7782\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":520}]},{"cell_type":"markdown","metadata":{"id":"b_55IC6F8iP_"},"source":["### Breath-first Search in Graph"]},{"cell_type":"markdown","metadata":{"id":"8YhKn3V3biau"},"source":["#### Track pahts and avoid cycle in the tree-based search"]},{"cell_type":"code","metadata":{"id":"9-iHJjQYWfPy"},"source":["# Track paths and avoid cycles\n","def bfs(g, s):\n","  q = [[s]]\n","  paths, orders = [], []\n","  while q:\n","    path = q.pop(0)\n","    n = path[-1]\n","    orders.append(n)\n","    bEnd = True\n","    for v in g[n]:\n","      if v not in path:\n","        if bEnd:\n","          bEnd = False\n","        q.append(path + [v])\n","    if bEnd:\n","      paths.append(path)\n","  return paths, orders"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"LSYyXM_EXHxD","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839680406,"user_tz":480,"elapsed":5670,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"590521ea-deb7-4f93-dadf-e18881cf634c"},"source":["# Test free tree\n","bfs(ft, 0)"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0, 1, 2, 4, 3], [0, 1, 2, 4, 5]], [0, 1, 2, 4, 3, 5])"]},"metadata":{"tags":[]},"execution_count":522}]},{"cell_type":"code","metadata":{"id":"00091jV7Yr3z","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839680407,"user_tz":480,"elapsed":5657,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"6376b5c1-d2c3-4368-84e3-feadcafc95f3"},"source":["# Test dcg\n","bfs(dcg, 0)"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([[0, 1, 2, 4, 3], [0, 1, 2, 4, 5]], [0, 1, 2, 4, 3, 5])"]},"metadata":{"tags":[]},"execution_count":523}]},{"cell_type":"code","metadata":{"id":"1xo7CLOBYzyE","colab":{"base_uri":"https://localhost:8080/","height":72},"executionInfo":{"status":"ok","timestamp":1577839680409,"user_tz":480,"elapsed":5644,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"dd54c574-02ee-444d-9c52-c3afa45ae105"},"source":["# Test ucg\n","paths, orders = bfs(ucg, 0)\n","print(paths, orders)\n","'''\n","From dfs\n","[[0, 1, 2, 4, 3],\n","  [0, 1, 2, 4, 5],\n","  [0, 1, 3, 4, 2],\n","  [0, 1, 3, 4, 5],\n","  [0, 2, 1, 3, 4, 5],\n","  [0, 2, 4, 3, 1],\n","  [0, 2, 4, 5]],\n","'''\n","print(len(orders))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[[0, 2, 4, 5], [0, 1, 2, 4, 3], [0, 1, 2, 4, 5], [0, 1, 3, 4, 2], [0, 1, 3, 4, 5], [0, 2, 4, 3, 1], [0, 2, 1, 3, 4, 5]] [0, 1, 2, 2, 3, 1, 4, 4, 4, 3, 3, 5, 3, 5, 2, 5, 4, 1, 5]\n","19\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"OaceX9XiboJr"},"source":["#### Graph-based search that avoids repeating vertex"]},{"cell_type":"code","metadata":{"id":"r6g03TClZAJu"},"source":["# Track paths and avoid cycles in a memory efficient way\n","# Only track shortest paths\n","def bfgs(g, s, t):\n","  q = [s]\n","  bfgs.parent = {}\n","  visited = {s}\n","  while q:\n","    n = q.pop(0)\n","    if n == t:\n","      return backtrace(s, t, bfgs.parent)\n","    for v in g[n]:\n","      if v not in visited:\n","        q.append(v)\n","        visited.add(v)\n","        bfgs.parent[v] = n\n","  return None"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"p1JuvjNMqZ0O"},"source":["#Print Shortest Path Iterative\n","def backtrace(s, t, parent):\n","  p = t\n","  path = []\n","  while p != s:\n","    path.append(p)\n","    p = parent[p]\n","  path.append(s)\n","  return path[::-1]"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"OGUHuKrb6EDu"},"source":["#Print Shortest Path Recursive\n","def get_path(s, t, pl, path):\n","  if s == t:   \n","    pass\n","  elif pl[t] is None:\n","    print('no path from ', s, ' to ', t)\n","  else:\n","    get_path(s, pl[t], pl, path)   \n","  path.append(t)\n","  return"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"7129c26IbK0N","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839680414,"user_tz":480,"elapsed":5605,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"ccb546e7-be27-4573-dfbe-63cf48b5cbbd"},"source":["# Test ucg\n","bfgs(ucg, 0, 5)"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[0, 2, 4, 5]"]},"metadata":{"tags":[]},"execution_count":528}]},{"cell_type":"code","metadata":{"id":"Mwt51VlKFI5-","colab":{"base_uri":"https://localhost:8080/","height":369},"executionInfo":{"status":"ok","timestamp":1577839680414,"user_tz":480,"elapsed":5592,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"482b57a4-29b1-4136-85fe-835ee577c4c2"},"source":["# Visualize the search tree\n","bfgs(ucg, 0, None)\n","parent = bfgs.parent\n","dot = Digraph(comment='The Round Table', format='png')\n","#print(get_methods(Digraph))\n","#print(Digraph.__dict__)\n","nodes = [0, 1, 2, 3, 4, 5]\n","for node in nodes:\n","    dot.node(name=str(node))\n","for s, p in parent.items():\n","    dot.edge(str(p), str(s))\n","#dot.edges(['01', '12','31', '20', '24','43', '45'])\n","dot.render('test-output/breath_first_graph_search_tree', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b63488940>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"134pt\" height=\"260pt\"\n viewBox=\"0.00 0.00 134.00 260.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 256)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-256 130,-256 130,4 -4,4\"/>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54.2854,-216.5708C50.0403,-208.0807 44.8464,-197.6929 40.1337,-188.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"43.237,-186.6477 35.6343,-179.2687 36.976,-189.7782 43.237,-186.6477\"/>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 0&#45;&gt;2 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M71.7146,-216.5708C75.9597,-208.0807 81.1536,-197.6929 85.8663,-188.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"89.024,-189.7782 90.3657,-179.2687 82.763,-186.6477 89.024,-189.7782\"/>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 1&#45;&gt;3 -->\n<g id=\"edge3\" class=\"edge\">\n<title>1&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M27,-143.8314C27,-136.131 27,-126.9743 27,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"30.5001,-118.4132 27,-108.4133 23.5001,-118.4133 30.5001,-118.4132\"/>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge4\" class=\"edge\">\n<title>2&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M99,-143.8314C99,-136.131 99,-126.9743 99,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"102.5001,-118.4132 99,-108.4133 95.5001,-118.4133 102.5001,-118.4132\"/>\n</g>\n<!-- 5 -->\n<g id=\"node6\" class=\"node\">\n<title>5</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 4&#45;&gt;5 -->\n<g id=\"edge5\" class=\"edge\">\n<title>4&#45;&gt;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M99,-71.8314C99,-64.131 99,-54.9743 99,-46.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"102.5001,-46.4132 99,-36.4133 95.5001,-46.4133 102.5001,-46.4132\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":529}]},{"cell_type":"markdown","metadata":{"id":"w0UuaLXj5bgZ"},"source":["#### Multiple Starts"]},{"cell_type":"code","metadata":{"id":"yg1tgj8Y5czv"},"source":["#Multiple Starts\n","def BFSLevel(starts):\n","    q = starts # a list of nodes\n","    #root.visited = 1\n","    while q:\n","        new_q = []\n","        for node in q:\n","            for neig in node.adjacent:\n","               if not neig.visited:\n","                   neig.visited = 1\n","                   new_q.append(neig)\n","        q = new_q"],"execution_count":null,"outputs":[]},{"cell_type":"markdown","metadata":{"id":"I-LT_HgDrrtI"},"source":["####Level by level bfs"]},{"cell_type":"code","metadata":{"id":"sQyW-n5qrt6k"},"source":["def bfs_level(g, s):\n","  '''level by level bfs'''\n","  v = len(g)\n","  state = [False] * v\n","  \n","  orders = []\n","  lst = [s]\n","  state[s] = True\n","  d = 0 # track distance\n","  while lst:\n","    print('distance ', d, ': ', lst)\n","    tmp_lst = []\n","    for u in lst:\n","      orders.append(u)\n","      for v in g[u]:\n","        if not state[v]:\n","          state[v] = True\n","          tmp_lst.append(v)    \n","    lst = tmp_lst\n","    d += 1\n","  return orders\n","          "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"KwUfwlRN2qbe","colab":{"base_uri":"https://localhost:8080/","height":104},"executionInfo":{"status":"ok","timestamp":1577839680425,"user_tz":480,"elapsed":5569,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"e2048ab1-018e-4141-ea4f-766d0cefd436"},"source":["print(bfs_level(ucg, 0))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["distance  0 :  [0]\n","distance  1 :  [1, 2]\n","distance  2 :  [3, 4]\n","distance  3 :  [5]\n","[0, 1, 2, 3, 4, 5]\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"KDFDgG-BOBml"},"source":["\n","## Depth-first Graph Search"]},{"cell_type":"markdown","metadata":{"id":"V0lQCtvcWWxi"},"source":["### Recursive Implementation"]},{"cell_type":"code","metadata":{"id":"ddy-8DejWciM"},"source":["#Recursive implementation with three states\n","def dfs(g, s, colors, orders, complete_orders):\n","  colors[s] = STATE.gray\n","  orders.append(s)\n","  for v in g[s]:\n","    if colors[v] == STATE.white:\n","      dfs(g, v, colors, orders, complete_orders)\n","  # complete\n","  colors[s] = STATE.black\n","  complete_orders.append(s)\n","  return"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"Co2HV7k4XDJm","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839680427,"user_tz":480,"elapsed":5552,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"4f4b44f1-ce20-4fc3-802b-254aa2d19898"},"source":["# initialization\n","'''start from 0'''\n","v = len(ucg)\n","orders, complete_orders = [], []\n","colors = [STATE.white] * v\n","dfs(ucg,0, colors, orders, complete_orders)\n","print(orders, complete_orders)"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[0, 1, 2, 4, 3, 5] [3, 5, 4, 2, 1, 0]\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"hjByXvweDX3c"},"source":["Visualizing the state change of nodes"]},{"cell_type":"code","metadata":{"id":"jDQvblzsOK9m"},"source":["# directed cyclc graph\n","dcg = [[] for _ in range(6)]\n","dcg[0] = [1, 2]\n","dcg[1] = [2, 4]\n","dcg[2] = [0, 4]\n","dcg[3] = [1]\n","dcg[4] = [3, 5]\n","dcg[5] = [3] # cross edge"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"7ZK2pX87OvMH","colab":{"base_uri":"https://localhost:8080/","height":369},"executionInfo":{"status":"ok","timestamp":1577839680429,"user_tz":480,"elapsed":5535,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"cb41c3bd-7aa5-4304-c571-0bb39aea86ad"},"source":["dot = Digraph(comment='The Round Table', format='png')\n","#print(get_methods(Digraph))\n","#print(Digraph.__dict__)\n","nodes = [0, 1, 2, 3, 4, 5]\n","rank1 = [0]\n","rank2 = [1, 2]\n","rank3=[3, 4]\n","rank4 = [5]\n","ranks=[rank1, rank2, rank3, rank4]\n","for i, rank in enumerate(ranks):\n","      with dot.subgraph(name=name+str(i)) as s:\n","        s.attr(rank='same')\n","        for node in rank:\n","          s.node(str(node))\n","dot.edges(['01', '02', '12', '14', '31', '20', '24','43', '45', '53'])\n","dot.render('test-output/directed_cyclic_graph_2', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b63430b00>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"134pt\" height=\"260pt\"\n viewBox=\"0.00 0.00 134.00 260.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 256)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-256 130,-256 130,4 -4,4\"/>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-218.7307C73.803,-208.803 60.6847,-195.6847 49.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-181.8436 42.2473,-177.2473 46.8436,-186.7933 51.7933,-181.8436\"/>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 0&#45;&gt;2 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M93.0843,-216.2022C92.2798,-208.1807 92.0571,-198.5231 92.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"95.9097,-189.8099 93.105,-179.593 88.9262,-189.3289 95.9097,-189.8099\"/>\n</g>\n<!-- 1&#45;&gt;2 -->\n<g id=\"edge3\" class=\"edge\">\n<title>1&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-162C56.6147,-162 59.2295,-162 61.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-165.5001 71.9297,-162 61.9297,-158.5001 61.9297,-165.5001\"/>\n</g>\n<!-- 4 -->\n<g id=\"node5\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 1&#45;&gt;4 -->\n<g id=\"edge4\" class=\"edge\">\n<title>1&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M27,-143.8314C27,-136.131 27,-126.9743 27,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"30.5001,-118.4132 27,-108.4133 23.5001,-118.4133 30.5001,-118.4132\"/>\n</g>\n<!-- 2&#45;&gt;0 -->\n<g id=\"edge6\" class=\"edge\">\n<title>2&#45;&gt;0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M104.895,-179.593C105.7094,-187.5865 105.942,-197.2363 105.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"102.0976,-205.9891 104.9157,-216.2022 109.0817,-206.4608 102.0976,-205.9891\"/>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge7\" class=\"edge\">\n<title>2&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-146.7307C73.803,-136.803 60.6847,-123.6847 49.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-109.8436 42.2473,-105.2473 46.8436,-114.7933 51.7933,-109.8436\"/>\n</g>\n<!-- 3 -->\n<g id=\"node4\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"99\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 3&#45;&gt;1 -->\n<g id=\"edge5\" class=\"edge\">\n<title>3&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7527,-105.2473C73.8297,-115.1703 60.7123,-128.2877 49.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"46.8656,-137.1847 42.2693,-146.7307 51.8153,-142.1344 46.8656,-137.1847\"/>\n</g>\n<!-- 4&#45;&gt;3 -->\n<g id=\"edge8\" class=\"edge\">\n<title>4&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-90C56.6147,-90 59.2295,-90 61.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-93.5001 71.9297,-90 61.9297,-86.5001 61.9297,-93.5001\"/>\n</g>\n<!-- 5 -->\n<g id=\"node6\" class=\"node\">\n<title>5</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"63\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 4&#45;&gt;5 -->\n<g id=\"edge9\" class=\"edge\">\n<title>4&#45;&gt;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M35.7146,-72.5708C39.9597,-64.0807 45.1536,-53.6929 49.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"53.024,-45.7782 54.3657,-35.2687 46.763,-42.6477 53.024,-45.7782\"/>\n</g>\n<!-- 5&#45;&gt;3 -->\n<g id=\"edge10\" class=\"edge\">\n<title>5&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M71.6343,-35.2687C75.8674,-43.7348 81.0583,-54.1166 85.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.6827,-65.1918 90.2854,-72.5708 88.9437,-62.0613 82.6827,-65.1918\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":536}]},{"cell_type":"code","metadata":{"id":"8TdvPlxTAVhp"},"source":["def set_node_style(dot, color, node, name):\n","  dot.attr('node', style='filled', fillcolor=color, fontcolor='red')#color=color)\n","  dot.node(name=name, label=str(node))\n","\n","\n","def plot(g, colors,  dot, edges, nodes):\n","  #dot = Digraph(comment='The Round Table', format='png')\n","  name = str(next(counter))\n","  \n","  with dot.subgraph(name=name) as s:\n","    for node in nodes:\n","      if colors[node] == STATE.gray:\n","        set_node_style(dot, 'gray', node, name=str(node)+name)\n","      elif colors[node] == STATE.black:\n","        set_node_style(dot, 'black', node, name=str(node)+name)\n","      else:\n","        set_node_style(dot, 'white', node, name=str(node)+name)\n","    for s, e in edges:\n","      dot.edge(str(s)+name, str(e)+name)\n","\n","  \n","    #s.edges(['01', '12','31', '20', '24','43', '45'])\n","    #dot.render('test-output/depth_first_graph_search'+str(next(counter)), view=True) \n","    #s.view()"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"Av-u8YzcCW8_"},"source":["def plot_state(g, colors,  dot, edges_list):\n","  #dot = Digraph(comment='The Round Table', format='png')\n","  name = str(next(counter))\n","  with dot.subgraph(name=name) as init:\n","    nodes = len(g)\n","    rank1 = [0]\n","    rank2 = [2, 1]\n","    rank3 = [4, 3]\n","    rank4 = [5]\n","    ranks = [rank1, rank2, rank3, rank4]\n","   \n","    for i, rank in enumerate(ranks):\n","      with init.subgraph(name=name+str(i)) as s:\n","        s.attr(rank='same')\n","        for node in rank:\n","          \n","          if colors[node] == STATE.gray:\n","            set_node_style(s, 'gray', node, name=str(node)+name)\n","          elif colors[node] == STATE.black:\n","            set_node_style(s, 'black', node, name=str(node)+name)\n","          else:\n","            set_node_style(s, 'white', node, name=str(node)+name)\n","      # \n","    for s in range(nodes):\n","      for e in g[s]:\n","        init.edge(str(s)+name, str(e)+name)\n","    # tracker = defaultdict(set) # edges\n","    # for s in range(nodes):\n","    #   for e in g[s]:\n","    #     ##print(s, e, tracker)\n","    #     if e in tracker and s in tracker[e]:\n","    #       continue\n","    #     else:\n","    #       tracker[s].add(e)\n","    #     init.edge(str(s)+name, str(e)+name)\n","        init.render('test-output/depth_first_graph_search_process'+name, view=True, format='png') "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"dwJMwokbXyPX"},"source":["def plot_all(g, colors,  dot, edges_list):\n","  #dot = Digraph(comment='The Round Table', format='png')\n","  name = str(next(counter))\n","  with dot.subgraph(name=name) as init:\n","    nodes = set()\n","    rank1 = [0]\n","    rank2 = [1]\n","    rank2_1=[2]\n","    rank3 = [4]\n","    rank4 = [3, 5]\n","    ranks = [rank1, rank2, rank2_1, rank3, rank4]\n","    for edges in edges_list:\n","      for s, e in edges:\n","        nodes.add(s)\n","        nodes.add(e)\n","   \n","    for i, rank in enumerate(ranks):\n","      with init.subgraph(name=name+str(i)) as s:\n","        s.attr(rank='same')\n","        for node in rank:\n","          if node not in nodes:\n","            continue\n","          \n","          if colors[node] == STATE.gray:\n","            set_node_style(s, 'gray', node, name=str(node)+name)\n","          elif colors[node] == STATE.black:\n","            set_node_style(s, 'black', node, name=str(node)+name)\n","          else:\n","            set_node_style(s, 'white', node, name=str(node)+name)\n","      # \n","    # tracker = defaultdict(set) # edges\n","    # for s in range(nodes):\n","    #   for e in g[s]:\n","    #     ##print(s, e, tracker)\n","    #     if e in tracker and s in tracker[e]:\n","    #       continue\n","    #     else:\n","    #       tracker[s].add(e)\n","    #     init.edge(str(s)+name, str(e)+name)\n","      \n","    \n","    colors = ['black', 'red']\n","    for i, edges in enumerate(edges_list):\n","      if not edges:\n","        continue\n","      for start, end in edges:\n","        if start is not None:\n","          init.edge(str(start)+name, str(end)+name,_attributes={'dir':'forward', 'color': colors[i]})\n","    init.render('test-output/depth_first_graph_search_process'+name, view=True, format='png') \n","\n"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"kLCE2dNJJjum"},"source":["!rm test-output/depth_first_graph_search*"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"SpzWbATRNjtL","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839684864,"user_tz":480,"elapsed":9928,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"05521fd1-9abb-46ae-98c4-50d1b2e9e076"},"source":["!rm *.gv*"],"execution_count":null,"outputs":[{"output_type":"stream","text":["rm: cannot remove '*.gv*': No such file or directory\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"TCNTJ6sBADIU"},"source":["# Visualizing\n","edges = []\n","back_edges = []\n","def dfs(g, s, colors, dot, nodes, pre_node):\n","  nodes.add(s)\n","  colors[s] = STATE.gray\n","  #plot(g, colors,  dot, edges, nodes)\n","  global edges\n","  global back_edges\n","  plot_fun(g, colors,  dot, [edges, back_edges])\n","  for v in g[s]:\n","    if colors[v] == STATE.white:\n","      edges += [(s, v)]\n","      dfs(g, v, colors, dot, nodes, s)\n","      back_edges += [(v, s)]\n","      #plot_fun(g, colors,  dot, [edges, back_edges])\n","  # complete\n","  \n","  colors[s] = STATE.black\n","  #plot(g, colors, dot, edges, nodes)\n","  plot_fun(g, colors,  dot, [edges, back_edges])\n","  return"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"3y8edac7CkYd","colab":{"base_uri":"https://localhost:8080/","height":406},"executionInfo":{"status":"ok","timestamp":1577839693978,"user_tz":480,"elapsed":19021,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"d562fdbd-be9b-48ee-ebe4-a4ecfaaaa0a3"},"source":["# Plot_state\n","import itertools\n","counter = itertools.count()\n","print(dcg)\n","v = len(dcg)\n","colors = [STATE.white] * v\n","dot = Digraph(comment='The Round Table', format='png')\n","plot_fun = plot_state\n","dfs(dcg,0, colors, dot, set(), None)\n","dot.render('test-output/depth_first_graph_search_process', view=True) \n","dot"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[[1, 2], [2, 4], [0, 4], [1], [3, 5], [3]]\n"],"name":"stdout"},{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b634306d8>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"1727pt\" height=\"260pt\"\n viewBox=\"0.00 0.00 1727.00 260.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 256)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-256 1723,-256 1723,4 -4,4\"/>\n<!-- 00 -->\n<g id=\"node1\" class=\"node\">\n<title>00</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"99\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 20 -->\n<g id=\"node2\" class=\"node\">\n<title>20</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"99\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 00&#45;&gt;20 -->\n<g id=\"edge2\" class=\"edge\">\n<title>00&#45;&gt;20</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M93.0843,-216.2022C92.2798,-208.1807 92.0571,-198.5231 92.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"95.9097,-189.8099 93.105,-179.593 88.9262,-189.3289 95.9097,-189.8099\"/>\n</g>\n<!-- 10 -->\n<g id=\"node3\" class=\"node\">\n<title>10</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 00&#45;&gt;10 -->\n<g id=\"edge1\" class=\"edge\">\n<title>00&#45;&gt;10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-218.7307C73.803,-208.803 60.6847,-195.6847 49.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-181.8436 42.2473,-177.2473 46.8436,-186.7933 51.7933,-181.8436\"/>\n</g>\n<!-- 20&#45;&gt;00 -->\n<g id=\"edge5\" class=\"edge\">\n<title>20&#45;&gt;00</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M104.895,-179.593C105.7094,-187.5865 105.942,-197.2363 105.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"102.0976,-205.9891 104.9157,-216.2022 109.0817,-206.4608 102.0976,-205.9891\"/>\n</g>\n<!-- 40 -->\n<g id=\"node4\" class=\"node\">\n<title>40</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"27\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 20&#45;&gt;40 -->\n<g id=\"edge6\" class=\"edge\">\n<title>20&#45;&gt;40</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-146.7307C73.803,-136.803 60.6847,-123.6847 49.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-109.8436 42.2473,-105.2473 46.8436,-114.7933 51.7933,-109.8436\"/>\n</g>\n<!-- 10&#45;&gt;20 -->\n<g id=\"edge3\" class=\"edge\">\n<title>10&#45;&gt;20</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-162C56.6147,-162 59.2295,-162 61.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-165.5001 71.9297,-162 61.9297,-158.5001 61.9297,-165.5001\"/>\n</g>\n<!-- 10&#45;&gt;40 -->\n<g id=\"edge4\" class=\"edge\">\n<title>10&#45;&gt;40</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M27,-143.8314C27,-136.131 27,-126.9743 27,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"30.5001,-118.4132 27,-108.4133 23.5001,-118.4133 30.5001,-118.4132\"/>\n</g>\n<!-- 30 -->\n<g id=\"node5\" class=\"node\">\n<title>30</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"99\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 40&#45;&gt;30 -->\n<g id=\"edge8\" class=\"edge\">\n<title>40&#45;&gt;30</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-90C56.6147,-90 59.2295,-90 61.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-93.5001 71.9297,-90 61.9297,-86.5001 61.9297,-93.5001\"/>\n</g>\n<!-- 50 -->\n<g id=\"node6\" class=\"node\">\n<title>50</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"63\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 40&#45;&gt;50 -->\n<g id=\"edge9\" class=\"edge\">\n<title>40&#45;&gt;50</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M35.7146,-72.5708C39.9597,-64.0807 45.1536,-53.6929 49.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"53.024,-45.7782 54.3657,-35.2687 46.763,-42.6477 53.024,-45.7782\"/>\n</g>\n<!-- 30&#45;&gt;10 -->\n<g id=\"edge7\" class=\"edge\">\n<title>30&#45;&gt;10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7527,-105.2473C73.8297,-115.1703 60.7123,-128.2877 49.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"46.8656,-137.1847 42.2693,-146.7307 51.8153,-142.1344 46.8656,-137.1847\"/>\n</g>\n<!-- 50&#45;&gt;30 -->\n<g id=\"edge10\" class=\"edge\">\n<title>50&#45;&gt;30</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M71.6343,-35.2687C75.8674,-43.7348 81.0583,-54.1166 85.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.6827,-65.1918 90.2854,-72.5708 88.9437,-62.0613 82.6827,-65.1918\"/>\n</g>\n<!-- 01 -->\n<g id=\"node7\" class=\"node\">\n<title>01</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"243\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"243\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 21 -->\n<g id=\"node8\" class=\"node\">\n<title>21</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"243\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"243\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 01&#45;&gt;21 -->\n<g id=\"edge12\" class=\"edge\">\n<title>01&#45;&gt;21</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M237.0843,-216.2022C236.2798,-208.1807 236.0571,-198.5231 236.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.9097,-189.8099 237.105,-179.593 232.9262,-189.3289 239.9097,-189.8099\"/>\n</g>\n<!-- 11 -->\n<g id=\"node9\" class=\"node\">\n<title>11</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"171\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"171\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 01&#45;&gt;11 -->\n<g id=\"edge11\" class=\"edge\">\n<title>01&#45;&gt;11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M227.7307,-218.7307C217.803,-208.803 204.6847,-195.6847 193.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.7933,-181.8436 186.2473,-177.2473 190.8436,-186.7933 195.7933,-181.8436\"/>\n</g>\n<!-- 21&#45;&gt;01 -->\n<g id=\"edge15\" class=\"edge\">\n<title>21&#45;&gt;01</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M248.895,-179.593C249.7094,-187.5865 249.942,-197.2363 249.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"246.0976,-205.9891 248.9157,-216.2022 253.0817,-206.4608 246.0976,-205.9891\"/>\n</g>\n<!-- 41 -->\n<g id=\"node10\" class=\"node\">\n<title>41</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"171\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"171\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 21&#45;&gt;41 -->\n<g id=\"edge16\" class=\"edge\">\n<title>21&#45;&gt;41</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M227.7307,-146.7307C217.803,-136.803 204.6847,-123.6847 193.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.7933,-109.8436 186.2473,-105.2473 190.8436,-114.7933 195.7933,-109.8436\"/>\n</g>\n<!-- 11&#45;&gt;21 -->\n<g id=\"edge13\" class=\"edge\">\n<title>11&#45;&gt;21</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M198,-162C200.6147,-162 203.2295,-162 205.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"205.9297,-165.5001 215.9297,-162 205.9297,-158.5001 205.9297,-165.5001\"/>\n</g>\n<!-- 11&#45;&gt;41 -->\n<g id=\"edge14\" class=\"edge\">\n<title>11&#45;&gt;41</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M171,-143.8314C171,-136.131 171,-126.9743 171,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"174.5001,-118.4132 171,-108.4133 167.5001,-118.4133 174.5001,-118.4132\"/>\n</g>\n<!-- 31 -->\n<g id=\"node11\" class=\"node\">\n<title>31</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"243\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"243\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 41&#45;&gt;31 -->\n<g id=\"edge18\" class=\"edge\">\n<title>41&#45;&gt;31</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M198,-90C200.6147,-90 203.2295,-90 205.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"205.9297,-93.5001 215.9297,-90 205.9297,-86.5001 205.9297,-93.5001\"/>\n</g>\n<!-- 51 -->\n<g id=\"node12\" class=\"node\">\n<title>51</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"207\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"207\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 41&#45;&gt;51 -->\n<g id=\"edge19\" class=\"edge\">\n<title>41&#45;&gt;51</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M179.7146,-72.5708C183.9597,-64.0807 189.1536,-53.6929 193.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"197.024,-45.7782 198.3657,-35.2687 190.763,-42.6477 197.024,-45.7782\"/>\n</g>\n<!-- 31&#45;&gt;11 -->\n<g id=\"edge17\" class=\"edge\">\n<title>31&#45;&gt;11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M227.7527,-105.2473C217.8297,-115.1703 204.7123,-128.2877 193.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"190.8656,-137.1847 186.2693,-146.7307 195.8153,-142.1344 190.8656,-137.1847\"/>\n</g>\n<!-- 51&#45;&gt;31 -->\n<g id=\"edge20\" class=\"edge\">\n<title>51&#45;&gt;31</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M215.6343,-35.2687C219.8674,-43.7348 225.0583,-54.1166 229.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"226.6827,-65.1918 234.2854,-72.5708 232.9437,-62.0613 226.6827,-65.1918\"/>\n</g>\n<!-- 02 -->\n<g id=\"node13\" class=\"node\">\n<title>02</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"387\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 22 -->\n<g id=\"node14\" class=\"node\">\n<title>22</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"387\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 02&#45;&gt;22 -->\n<g id=\"edge22\" class=\"edge\">\n<title>02&#45;&gt;22</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M381.0843,-216.2022C380.2798,-208.1807 380.0571,-198.5231 380.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"383.9097,-189.8099 381.105,-179.593 376.9262,-189.3289 383.9097,-189.8099\"/>\n</g>\n<!-- 12 -->\n<g id=\"node15\" class=\"node\">\n<title>12</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"315\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 02&#45;&gt;12 -->\n<g id=\"edge21\" class=\"edge\">\n<title>02&#45;&gt;12</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M371.7307,-218.7307C361.803,-208.803 348.6847,-195.6847 337.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"339.7933,-181.8436 330.2473,-177.2473 334.8436,-186.7933 339.7933,-181.8436\"/>\n</g>\n<!-- 22&#45;&gt;02 -->\n<g id=\"edge25\" class=\"edge\">\n<title>22&#45;&gt;02</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M392.895,-179.593C393.7094,-187.5865 393.942,-197.2363 393.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"390.0976,-205.9891 392.9157,-216.2022 397.0817,-206.4608 390.0976,-205.9891\"/>\n</g>\n<!-- 42 -->\n<g id=\"node16\" class=\"node\">\n<title>42</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"315\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 22&#45;&gt;42 -->\n<g id=\"edge26\" class=\"edge\">\n<title>22&#45;&gt;42</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M371.7307,-146.7307C361.803,-136.803 348.6847,-123.6847 337.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"339.7933,-109.8436 330.2473,-105.2473 334.8436,-114.7933 339.7933,-109.8436\"/>\n</g>\n<!-- 12&#45;&gt;22 -->\n<g id=\"edge23\" class=\"edge\">\n<title>12&#45;&gt;22</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M342,-162C344.6147,-162 347.2295,-162 349.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"349.9297,-165.5001 359.9297,-162 349.9297,-158.5001 349.9297,-165.5001\"/>\n</g>\n<!-- 12&#45;&gt;42 -->\n<g id=\"edge24\" class=\"edge\">\n<title>12&#45;&gt;42</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M315,-143.8314C315,-136.131 315,-126.9743 315,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"318.5001,-118.4132 315,-108.4133 311.5001,-118.4133 318.5001,-118.4132\"/>\n</g>\n<!-- 32 -->\n<g id=\"node17\" class=\"node\">\n<title>32</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"387\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 42&#45;&gt;32 -->\n<g id=\"edge28\" class=\"edge\">\n<title>42&#45;&gt;32</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M342,-90C344.6147,-90 347.2295,-90 349.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"349.9297,-93.5001 359.9297,-90 349.9297,-86.5001 349.9297,-93.5001\"/>\n</g>\n<!-- 52 -->\n<g id=\"node18\" class=\"node\">\n<title>52</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"351\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"351\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 42&#45;&gt;52 -->\n<g id=\"edge29\" class=\"edge\">\n<title>42&#45;&gt;52</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M323.7146,-72.5708C327.9597,-64.0807 333.1536,-53.6929 337.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"341.024,-45.7782 342.3657,-35.2687 334.763,-42.6477 341.024,-45.7782\"/>\n</g>\n<!-- 32&#45;&gt;12 -->\n<g id=\"edge27\" class=\"edge\">\n<title>32&#45;&gt;12</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M371.7527,-105.2473C361.8297,-115.1703 348.7123,-128.2877 337.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"334.8656,-137.1847 330.2693,-146.7307 339.8153,-142.1344 334.8656,-137.1847\"/>\n</g>\n<!-- 52&#45;&gt;32 -->\n<g id=\"edge30\" class=\"edge\">\n<title>52&#45;&gt;32</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M359.6343,-35.2687C363.8674,-43.7348 369.0583,-54.1166 373.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"370.6827,-65.1918 378.2854,-72.5708 376.9437,-62.0613 370.6827,-65.1918\"/>\n</g>\n<!-- 03 -->\n<g id=\"node19\" class=\"node\">\n<title>03</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"531\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"531\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 23 -->\n<g id=\"node20\" class=\"node\">\n<title>23</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"531\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"531\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 03&#45;&gt;23 -->\n<g id=\"edge32\" class=\"edge\">\n<title>03&#45;&gt;23</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M525.0843,-216.2022C524.2798,-208.1807 524.0571,-198.5231 524.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"527.9097,-189.8099 525.105,-179.593 520.9262,-189.3289 527.9097,-189.8099\"/>\n</g>\n<!-- 13 -->\n<g id=\"node21\" class=\"node\">\n<title>13</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"459\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"459\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 03&#45;&gt;13 -->\n<g id=\"edge31\" class=\"edge\">\n<title>03&#45;&gt;13</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M515.7307,-218.7307C505.803,-208.803 492.6847,-195.6847 481.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"483.7933,-181.8436 474.2473,-177.2473 478.8436,-186.7933 483.7933,-181.8436\"/>\n</g>\n<!-- 23&#45;&gt;03 -->\n<g id=\"edge35\" class=\"edge\">\n<title>23&#45;&gt;03</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M536.895,-179.593C537.7094,-187.5865 537.942,-197.2363 537.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"534.0976,-205.9891 536.9157,-216.2022 541.0817,-206.4608 534.0976,-205.9891\"/>\n</g>\n<!-- 43 -->\n<g id=\"node22\" class=\"node\">\n<title>43</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"459\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"459\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 23&#45;&gt;43 -->\n<g id=\"edge36\" class=\"edge\">\n<title>23&#45;&gt;43</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M515.7307,-146.7307C505.803,-136.803 492.6847,-123.6847 481.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"483.7933,-109.8436 474.2473,-105.2473 478.8436,-114.7933 483.7933,-109.8436\"/>\n</g>\n<!-- 13&#45;&gt;23 -->\n<g id=\"edge33\" class=\"edge\">\n<title>13&#45;&gt;23</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M486,-162C488.6147,-162 491.2295,-162 493.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"493.9297,-165.5001 503.9297,-162 493.9297,-158.5001 493.9297,-165.5001\"/>\n</g>\n<!-- 13&#45;&gt;43 -->\n<g id=\"edge34\" class=\"edge\">\n<title>13&#45;&gt;43</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M459,-143.8314C459,-136.131 459,-126.9743 459,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"462.5001,-118.4132 459,-108.4133 455.5001,-118.4133 462.5001,-118.4132\"/>\n</g>\n<!-- 33 -->\n<g id=\"node23\" class=\"node\">\n<title>33</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"531\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"531\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 43&#45;&gt;33 -->\n<g id=\"edge38\" class=\"edge\">\n<title>43&#45;&gt;33</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M486,-90C488.6147,-90 491.2295,-90 493.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"493.9297,-93.5001 503.9297,-90 493.9297,-86.5001 493.9297,-93.5001\"/>\n</g>\n<!-- 53 -->\n<g id=\"node24\" class=\"node\">\n<title>53</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"495\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"495\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 43&#45;&gt;53 -->\n<g id=\"edge39\" class=\"edge\">\n<title>43&#45;&gt;53</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M467.7146,-72.5708C471.9597,-64.0807 477.1536,-53.6929 481.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"485.024,-45.7782 486.3657,-35.2687 478.763,-42.6477 485.024,-45.7782\"/>\n</g>\n<!-- 33&#45;&gt;13 -->\n<g id=\"edge37\" class=\"edge\">\n<title>33&#45;&gt;13</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M515.7527,-105.2473C505.8297,-115.1703 492.7123,-128.2877 481.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"478.8656,-137.1847 474.2693,-146.7307 483.8153,-142.1344 478.8656,-137.1847\"/>\n</g>\n<!-- 53&#45;&gt;33 -->\n<g id=\"edge40\" class=\"edge\">\n<title>53&#45;&gt;33</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M503.6343,-35.2687C507.8674,-43.7348 513.0583,-54.1166 517.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"514.6827,-65.1918 522.2854,-72.5708 520.9437,-62.0613 514.6827,-65.1918\"/>\n</g>\n<!-- 04 -->\n<g id=\"node25\" class=\"node\">\n<title>04</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"675\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"675\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 24 -->\n<g id=\"node26\" class=\"node\">\n<title>24</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"675\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"675\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 04&#45;&gt;24 -->\n<g id=\"edge42\" class=\"edge\">\n<title>04&#45;&gt;24</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M669.0843,-216.2022C668.2798,-208.1807 668.0571,-198.5231 668.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"671.9097,-189.8099 669.105,-179.593 664.9262,-189.3289 671.9097,-189.8099\"/>\n</g>\n<!-- 14 -->\n<g id=\"node27\" class=\"node\">\n<title>14</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"603\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"603\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 04&#45;&gt;14 -->\n<g id=\"edge41\" class=\"edge\">\n<title>04&#45;&gt;14</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M659.7307,-218.7307C649.803,-208.803 636.6847,-195.6847 625.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"627.7933,-181.8436 618.2473,-177.2473 622.8436,-186.7933 627.7933,-181.8436\"/>\n</g>\n<!-- 24&#45;&gt;04 -->\n<g id=\"edge45\" class=\"edge\">\n<title>24&#45;&gt;04</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M680.895,-179.593C681.7094,-187.5865 681.942,-197.2363 681.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"678.0976,-205.9891 680.9157,-216.2022 685.0817,-206.4608 678.0976,-205.9891\"/>\n</g>\n<!-- 44 -->\n<g id=\"node28\" class=\"node\">\n<title>44</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"603\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"603\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 24&#45;&gt;44 -->\n<g id=\"edge46\" class=\"edge\">\n<title>24&#45;&gt;44</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M659.7307,-146.7307C649.803,-136.803 636.6847,-123.6847 625.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"627.7933,-109.8436 618.2473,-105.2473 622.8436,-114.7933 627.7933,-109.8436\"/>\n</g>\n<!-- 14&#45;&gt;24 -->\n<g id=\"edge43\" class=\"edge\">\n<title>14&#45;&gt;24</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M630,-162C632.6147,-162 635.2295,-162 637.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"637.9297,-165.5001 647.9297,-162 637.9297,-158.5001 637.9297,-165.5001\"/>\n</g>\n<!-- 14&#45;&gt;44 -->\n<g id=\"edge44\" class=\"edge\">\n<title>14&#45;&gt;44</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M603,-143.8314C603,-136.131 603,-126.9743 603,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"606.5001,-118.4132 603,-108.4133 599.5001,-118.4133 606.5001,-118.4132\"/>\n</g>\n<!-- 34 -->\n<g id=\"node29\" class=\"node\">\n<title>34</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"675\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"675\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 44&#45;&gt;34 -->\n<g id=\"edge48\" class=\"edge\">\n<title>44&#45;&gt;34</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M630,-90C632.6147,-90 635.2295,-90 637.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"637.9297,-93.5001 647.9297,-90 637.9297,-86.5001 637.9297,-93.5001\"/>\n</g>\n<!-- 54 -->\n<g id=\"node30\" class=\"node\">\n<title>54</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"639\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"639\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 44&#45;&gt;54 -->\n<g id=\"edge49\" class=\"edge\">\n<title>44&#45;&gt;54</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M611.7146,-72.5708C615.9597,-64.0807 621.1536,-53.6929 625.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"629.024,-45.7782 630.3657,-35.2687 622.763,-42.6477 629.024,-45.7782\"/>\n</g>\n<!-- 34&#45;&gt;14 -->\n<g id=\"edge47\" class=\"edge\">\n<title>34&#45;&gt;14</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M659.7527,-105.2473C649.8297,-115.1703 636.7123,-128.2877 625.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"622.8656,-137.1847 618.2693,-146.7307 627.8153,-142.1344 622.8656,-137.1847\"/>\n</g>\n<!-- 54&#45;&gt;34 -->\n<g id=\"edge50\" class=\"edge\">\n<title>54&#45;&gt;34</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M647.6343,-35.2687C651.8674,-43.7348 657.0583,-54.1166 661.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"658.6827,-65.1918 666.2854,-72.5708 664.9437,-62.0613 658.6827,-65.1918\"/>\n</g>\n<!-- 05 -->\n<g id=\"node31\" class=\"node\">\n<title>05</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"819\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"819\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 25 -->\n<g id=\"node32\" class=\"node\">\n<title>25</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"819\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"819\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 05&#45;&gt;25 -->\n<g id=\"edge52\" class=\"edge\">\n<title>05&#45;&gt;25</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M813.0843,-216.2022C812.2798,-208.1807 812.0571,-198.5231 812.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"815.9097,-189.8099 813.105,-179.593 808.9262,-189.3289 815.9097,-189.8099\"/>\n</g>\n<!-- 15 -->\n<g id=\"node33\" class=\"node\">\n<title>15</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"747\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"747\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 05&#45;&gt;15 -->\n<g id=\"edge51\" class=\"edge\">\n<title>05&#45;&gt;15</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M803.7307,-218.7307C793.803,-208.803 780.6847,-195.6847 769.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"771.7933,-181.8436 762.2473,-177.2473 766.8436,-186.7933 771.7933,-181.8436\"/>\n</g>\n<!-- 25&#45;&gt;05 -->\n<g id=\"edge55\" class=\"edge\">\n<title>25&#45;&gt;05</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M824.895,-179.593C825.7094,-187.5865 825.942,-197.2363 825.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"822.0976,-205.9891 824.9157,-216.2022 829.0817,-206.4608 822.0976,-205.9891\"/>\n</g>\n<!-- 45 -->\n<g id=\"node34\" class=\"node\">\n<title>45</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"747\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"747\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 25&#45;&gt;45 -->\n<g id=\"edge56\" class=\"edge\">\n<title>25&#45;&gt;45</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M803.7307,-146.7307C793.803,-136.803 780.6847,-123.6847 769.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"771.7933,-109.8436 762.2473,-105.2473 766.8436,-114.7933 771.7933,-109.8436\"/>\n</g>\n<!-- 15&#45;&gt;25 -->\n<g id=\"edge53\" class=\"edge\">\n<title>15&#45;&gt;25</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M774,-162C776.6147,-162 779.2295,-162 781.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"781.9297,-165.5001 791.9297,-162 781.9297,-158.5001 781.9297,-165.5001\"/>\n</g>\n<!-- 15&#45;&gt;45 -->\n<g id=\"edge54\" class=\"edge\">\n<title>15&#45;&gt;45</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M747,-143.8314C747,-136.131 747,-126.9743 747,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"750.5001,-118.4132 747,-108.4133 743.5001,-118.4133 750.5001,-118.4132\"/>\n</g>\n<!-- 35 -->\n<g id=\"node35\" class=\"node\">\n<title>35</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"819\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"819\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 45&#45;&gt;35 -->\n<g id=\"edge58\" class=\"edge\">\n<title>45&#45;&gt;35</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M774,-90C776.6147,-90 779.2295,-90 781.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"781.9297,-93.5001 791.9297,-90 781.9297,-86.5001 781.9297,-93.5001\"/>\n</g>\n<!-- 55 -->\n<g id=\"node36\" class=\"node\">\n<title>55</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"783\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"783\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 45&#45;&gt;55 -->\n<g id=\"edge59\" class=\"edge\">\n<title>45&#45;&gt;55</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M755.7146,-72.5708C759.9597,-64.0807 765.1536,-53.6929 769.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"773.024,-45.7782 774.3657,-35.2687 766.763,-42.6477 773.024,-45.7782\"/>\n</g>\n<!-- 35&#45;&gt;15 -->\n<g id=\"edge57\" class=\"edge\">\n<title>35&#45;&gt;15</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M803.7527,-105.2473C793.8297,-115.1703 780.7123,-128.2877 769.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"766.8656,-137.1847 762.2693,-146.7307 771.8153,-142.1344 766.8656,-137.1847\"/>\n</g>\n<!-- 55&#45;&gt;35 -->\n<g id=\"edge60\" class=\"edge\">\n<title>55&#45;&gt;35</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M791.6343,-35.2687C795.8674,-43.7348 801.0583,-54.1166 805.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"802.6827,-65.1918 810.2854,-72.5708 808.9437,-62.0613 802.6827,-65.1918\"/>\n</g>\n<!-- 06 -->\n<g id=\"node37\" class=\"node\">\n<title>06</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"963\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"963\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 26 -->\n<g id=\"node38\" class=\"node\">\n<title>26</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"963\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"963\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 06&#45;&gt;26 -->\n<g id=\"edge62\" class=\"edge\">\n<title>06&#45;&gt;26</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M957.0843,-216.2022C956.2798,-208.1807 956.0571,-198.5231 956.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"959.9097,-189.8099 957.105,-179.593 952.9262,-189.3289 959.9097,-189.8099\"/>\n</g>\n<!-- 16 -->\n<g id=\"node39\" class=\"node\">\n<title>16</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"891\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"891\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 06&#45;&gt;16 -->\n<g id=\"edge61\" class=\"edge\">\n<title>06&#45;&gt;16</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M947.7307,-218.7307C937.803,-208.803 924.6847,-195.6847 913.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"915.7933,-181.8436 906.2473,-177.2473 910.8436,-186.7933 915.7933,-181.8436\"/>\n</g>\n<!-- 26&#45;&gt;06 -->\n<g id=\"edge65\" class=\"edge\">\n<title>26&#45;&gt;06</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M968.895,-179.593C969.7094,-187.5865 969.942,-197.2363 969.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"966.0976,-205.9891 968.9157,-216.2022 973.0817,-206.4608 966.0976,-205.9891\"/>\n</g>\n<!-- 46 -->\n<g id=\"node40\" class=\"node\">\n<title>46</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"891\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"891\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 26&#45;&gt;46 -->\n<g id=\"edge66\" class=\"edge\">\n<title>26&#45;&gt;46</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M947.7307,-146.7307C937.803,-136.803 924.6847,-123.6847 913.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"915.7933,-109.8436 906.2473,-105.2473 910.8436,-114.7933 915.7933,-109.8436\"/>\n</g>\n<!-- 16&#45;&gt;26 -->\n<g id=\"edge63\" class=\"edge\">\n<title>16&#45;&gt;26</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M918,-162C920.6147,-162 923.2295,-162 925.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"925.9297,-165.5001 935.9297,-162 925.9297,-158.5001 925.9297,-165.5001\"/>\n</g>\n<!-- 16&#45;&gt;46 -->\n<g id=\"edge64\" class=\"edge\">\n<title>16&#45;&gt;46</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M891,-143.8314C891,-136.131 891,-126.9743 891,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"894.5001,-118.4132 891,-108.4133 887.5001,-118.4133 894.5001,-118.4132\"/>\n</g>\n<!-- 36 -->\n<g id=\"node41\" class=\"node\">\n<title>36</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"963\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"963\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 46&#45;&gt;36 -->\n<g id=\"edge68\" class=\"edge\">\n<title>46&#45;&gt;36</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M918,-90C920.6147,-90 923.2295,-90 925.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"925.9297,-93.5001 935.9297,-90 925.9297,-86.5001 925.9297,-93.5001\"/>\n</g>\n<!-- 56 -->\n<g id=\"node42\" class=\"node\">\n<title>56</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"927\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"927\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 46&#45;&gt;56 -->\n<g id=\"edge69\" class=\"edge\">\n<title>46&#45;&gt;56</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M899.7146,-72.5708C903.9597,-64.0807 909.1536,-53.6929 913.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"917.024,-45.7782 918.3657,-35.2687 910.763,-42.6477 917.024,-45.7782\"/>\n</g>\n<!-- 36&#45;&gt;16 -->\n<g id=\"edge67\" class=\"edge\">\n<title>36&#45;&gt;16</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M947.7527,-105.2473C937.8297,-115.1703 924.7123,-128.2877 913.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"910.8656,-137.1847 906.2693,-146.7307 915.8153,-142.1344 910.8656,-137.1847\"/>\n</g>\n<!-- 56&#45;&gt;36 -->\n<g id=\"edge70\" class=\"edge\">\n<title>56&#45;&gt;36</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M935.6343,-35.2687C939.8674,-43.7348 945.0583,-54.1166 949.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"946.6827,-65.1918 954.2854,-72.5708 952.9437,-62.0613 946.6827,-65.1918\"/>\n</g>\n<!-- 07 -->\n<g id=\"node43\" class=\"node\">\n<title>07</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1107\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1107\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 27 -->\n<g id=\"node44\" class=\"node\">\n<title>27</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1107\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1107\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 07&#45;&gt;27 -->\n<g id=\"edge72\" class=\"edge\">\n<title>07&#45;&gt;27</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1101.0843,-216.2022C1100.2798,-208.1807 1100.0571,-198.5231 1100.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1103.9097,-189.8099 1101.105,-179.593 1096.9262,-189.3289 1103.9097,-189.8099\"/>\n</g>\n<!-- 17 -->\n<g id=\"node45\" class=\"node\">\n<title>17</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1035\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1035\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 07&#45;&gt;17 -->\n<g id=\"edge71\" class=\"edge\">\n<title>07&#45;&gt;17</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1091.7307,-218.7307C1081.803,-208.803 1068.6847,-195.6847 1057.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1059.7933,-181.8436 1050.2473,-177.2473 1054.8436,-186.7933 1059.7933,-181.8436\"/>\n</g>\n<!-- 27&#45;&gt;07 -->\n<g id=\"edge75\" class=\"edge\">\n<title>27&#45;&gt;07</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1112.895,-179.593C1113.7094,-187.5865 1113.942,-197.2363 1113.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1110.0976,-205.9891 1112.9157,-216.2022 1117.0817,-206.4608 1110.0976,-205.9891\"/>\n</g>\n<!-- 47 -->\n<g id=\"node46\" class=\"node\">\n<title>47</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1035\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1035\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 27&#45;&gt;47 -->\n<g id=\"edge76\" class=\"edge\">\n<title>27&#45;&gt;47</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1091.7307,-146.7307C1081.803,-136.803 1068.6847,-123.6847 1057.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1059.7933,-109.8436 1050.2473,-105.2473 1054.8436,-114.7933 1059.7933,-109.8436\"/>\n</g>\n<!-- 17&#45;&gt;27 -->\n<g id=\"edge73\" class=\"edge\">\n<title>17&#45;&gt;27</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1062,-162C1064.6147,-162 1067.2295,-162 1069.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1069.9297,-165.5001 1079.9297,-162 1069.9297,-158.5001 1069.9297,-165.5001\"/>\n</g>\n<!-- 17&#45;&gt;47 -->\n<g id=\"edge74\" class=\"edge\">\n<title>17&#45;&gt;47</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1035,-143.8314C1035,-136.131 1035,-126.9743 1035,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1038.5001,-118.4132 1035,-108.4133 1031.5001,-118.4133 1038.5001,-118.4132\"/>\n</g>\n<!-- 37 -->\n<g id=\"node47\" class=\"node\">\n<title>37</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1107\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1107\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 47&#45;&gt;37 -->\n<g id=\"edge78\" class=\"edge\">\n<title>47&#45;&gt;37</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1062,-90C1064.6147,-90 1067.2295,-90 1069.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1069.9297,-93.5001 1079.9297,-90 1069.9297,-86.5001 1069.9297,-93.5001\"/>\n</g>\n<!-- 57 -->\n<g id=\"node48\" class=\"node\">\n<title>57</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1071\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1071\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 47&#45;&gt;57 -->\n<g id=\"edge79\" class=\"edge\">\n<title>47&#45;&gt;57</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1043.7146,-72.5708C1047.9597,-64.0807 1053.1536,-53.6929 1057.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1061.024,-45.7782 1062.3657,-35.2687 1054.763,-42.6477 1061.024,-45.7782\"/>\n</g>\n<!-- 37&#45;&gt;17 -->\n<g id=\"edge77\" class=\"edge\">\n<title>37&#45;&gt;17</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1091.7527,-105.2473C1081.8297,-115.1703 1068.7123,-128.2877 1057.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1054.8656,-137.1847 1050.2693,-146.7307 1059.8153,-142.1344 1054.8656,-137.1847\"/>\n</g>\n<!-- 57&#45;&gt;37 -->\n<g id=\"edge80\" class=\"edge\">\n<title>57&#45;&gt;37</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1079.6343,-35.2687C1083.8674,-43.7348 1089.0583,-54.1166 1093.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1090.6827,-65.1918 1098.2854,-72.5708 1096.9437,-62.0613 1090.6827,-65.1918\"/>\n</g>\n<!-- 08 -->\n<g id=\"node49\" class=\"node\">\n<title>08</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1251\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1251\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 28 -->\n<g id=\"node50\" class=\"node\">\n<title>28</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1251\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1251\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 08&#45;&gt;28 -->\n<g id=\"edge82\" class=\"edge\">\n<title>08&#45;&gt;28</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1245.0843,-216.2022C1244.2798,-208.1807 1244.0571,-198.5231 1244.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1247.9097,-189.8099 1245.105,-179.593 1240.9262,-189.3289 1247.9097,-189.8099\"/>\n</g>\n<!-- 18 -->\n<g id=\"node51\" class=\"node\">\n<title>18</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1179\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1179\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 08&#45;&gt;18 -->\n<g id=\"edge81\" class=\"edge\">\n<title>08&#45;&gt;18</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1235.7307,-218.7307C1225.803,-208.803 1212.6847,-195.6847 1201.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1203.7933,-181.8436 1194.2473,-177.2473 1198.8436,-186.7933 1203.7933,-181.8436\"/>\n</g>\n<!-- 28&#45;&gt;08 -->\n<g id=\"edge85\" class=\"edge\">\n<title>28&#45;&gt;08</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1256.895,-179.593C1257.7094,-187.5865 1257.942,-197.2363 1257.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1254.0976,-205.9891 1256.9157,-216.2022 1261.0817,-206.4608 1254.0976,-205.9891\"/>\n</g>\n<!-- 48 -->\n<g id=\"node52\" class=\"node\">\n<title>48</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1179\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1179\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 28&#45;&gt;48 -->\n<g id=\"edge86\" class=\"edge\">\n<title>28&#45;&gt;48</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1235.7307,-146.7307C1225.803,-136.803 1212.6847,-123.6847 1201.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1203.7933,-109.8436 1194.2473,-105.2473 1198.8436,-114.7933 1203.7933,-109.8436\"/>\n</g>\n<!-- 18&#45;&gt;28 -->\n<g id=\"edge83\" class=\"edge\">\n<title>18&#45;&gt;28</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1206,-162C1208.6147,-162 1211.2295,-162 1213.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1213.9297,-165.5001 1223.9297,-162 1213.9297,-158.5001 1213.9297,-165.5001\"/>\n</g>\n<!-- 18&#45;&gt;48 -->\n<g id=\"edge84\" class=\"edge\">\n<title>18&#45;&gt;48</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1179,-143.8314C1179,-136.131 1179,-126.9743 1179,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1182.5001,-118.4132 1179,-108.4133 1175.5001,-118.4133 1182.5001,-118.4132\"/>\n</g>\n<!-- 38 -->\n<g id=\"node53\" class=\"node\">\n<title>38</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1251\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1251\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 48&#45;&gt;38 -->\n<g id=\"edge88\" class=\"edge\">\n<title>48&#45;&gt;38</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1206,-90C1208.6147,-90 1211.2295,-90 1213.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1213.9297,-93.5001 1223.9297,-90 1213.9297,-86.5001 1213.9297,-93.5001\"/>\n</g>\n<!-- 58 -->\n<g id=\"node54\" class=\"node\">\n<title>58</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1215\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1215\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 48&#45;&gt;58 -->\n<g id=\"edge89\" class=\"edge\">\n<title>48&#45;&gt;58</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1187.7146,-72.5708C1191.9597,-64.0807 1197.1536,-53.6929 1201.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1205.024,-45.7782 1206.3657,-35.2687 1198.763,-42.6477 1205.024,-45.7782\"/>\n</g>\n<!-- 38&#45;&gt;18 -->\n<g id=\"edge87\" class=\"edge\">\n<title>38&#45;&gt;18</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1235.7527,-105.2473C1225.8297,-115.1703 1212.7123,-128.2877 1201.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1198.8656,-137.1847 1194.2693,-146.7307 1203.8153,-142.1344 1198.8656,-137.1847\"/>\n</g>\n<!-- 58&#45;&gt;38 -->\n<g id=\"edge90\" class=\"edge\">\n<title>58&#45;&gt;38</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1223.6343,-35.2687C1227.8674,-43.7348 1233.0583,-54.1166 1237.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1234.6827,-65.1918 1242.2854,-72.5708 1240.9437,-62.0613 1234.6827,-65.1918\"/>\n</g>\n<!-- 09 -->\n<g id=\"node55\" class=\"node\">\n<title>09</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1395\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1395\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 29 -->\n<g id=\"node56\" class=\"node\">\n<title>29</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1395\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1395\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 09&#45;&gt;29 -->\n<g id=\"edge92\" class=\"edge\">\n<title>09&#45;&gt;29</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1389.0843,-216.2022C1388.2798,-208.1807 1388.0571,-198.5231 1388.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1391.9097,-189.8099 1389.105,-179.593 1384.9262,-189.3289 1391.9097,-189.8099\"/>\n</g>\n<!-- 19 -->\n<g id=\"node57\" class=\"node\">\n<title>19</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1323\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1323\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 09&#45;&gt;19 -->\n<g id=\"edge91\" class=\"edge\">\n<title>09&#45;&gt;19</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1379.7307,-218.7307C1369.803,-208.803 1356.6847,-195.6847 1345.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1347.7933,-181.8436 1338.2473,-177.2473 1342.8436,-186.7933 1347.7933,-181.8436\"/>\n</g>\n<!-- 29&#45;&gt;09 -->\n<g id=\"edge95\" class=\"edge\">\n<title>29&#45;&gt;09</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1400.895,-179.593C1401.7094,-187.5865 1401.942,-197.2363 1401.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1398.0976,-205.9891 1400.9157,-216.2022 1405.0817,-206.4608 1398.0976,-205.9891\"/>\n</g>\n<!-- 49 -->\n<g id=\"node58\" class=\"node\">\n<title>49</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1323\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1323\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 29&#45;&gt;49 -->\n<g id=\"edge96\" class=\"edge\">\n<title>29&#45;&gt;49</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1379.7307,-146.7307C1369.803,-136.803 1356.6847,-123.6847 1345.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1347.7933,-109.8436 1338.2473,-105.2473 1342.8436,-114.7933 1347.7933,-109.8436\"/>\n</g>\n<!-- 19&#45;&gt;29 -->\n<g id=\"edge93\" class=\"edge\">\n<title>19&#45;&gt;29</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1350,-162C1352.6147,-162 1355.2295,-162 1357.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1357.9297,-165.5001 1367.9297,-162 1357.9297,-158.5001 1357.9297,-165.5001\"/>\n</g>\n<!-- 19&#45;&gt;49 -->\n<g id=\"edge94\" class=\"edge\">\n<title>19&#45;&gt;49</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1323,-143.8314C1323,-136.131 1323,-126.9743 1323,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1326.5001,-118.4132 1323,-108.4133 1319.5001,-118.4133 1326.5001,-118.4132\"/>\n</g>\n<!-- 39 -->\n<g id=\"node59\" class=\"node\">\n<title>39</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1395\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1395\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 49&#45;&gt;39 -->\n<g id=\"edge98\" class=\"edge\">\n<title>49&#45;&gt;39</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1350,-90C1352.6147,-90 1355.2295,-90 1357.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1357.9297,-93.5001 1367.9297,-90 1357.9297,-86.5001 1357.9297,-93.5001\"/>\n</g>\n<!-- 59 -->\n<g id=\"node60\" class=\"node\">\n<title>59</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1359\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1359\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 49&#45;&gt;59 -->\n<g id=\"edge99\" class=\"edge\">\n<title>49&#45;&gt;59</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1331.7146,-72.5708C1335.9597,-64.0807 1341.1536,-53.6929 1345.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1349.024,-45.7782 1350.3657,-35.2687 1342.763,-42.6477 1349.024,-45.7782\"/>\n</g>\n<!-- 39&#45;&gt;19 -->\n<g id=\"edge97\" class=\"edge\">\n<title>39&#45;&gt;19</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1379.7527,-105.2473C1369.8297,-115.1703 1356.7123,-128.2877 1345.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1342.8656,-137.1847 1338.2693,-146.7307 1347.8153,-142.1344 1342.8656,-137.1847\"/>\n</g>\n<!-- 59&#45;&gt;39 -->\n<g id=\"edge100\" class=\"edge\">\n<title>59&#45;&gt;39</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1367.6343,-35.2687C1371.8674,-43.7348 1377.0583,-54.1166 1381.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1378.6827,-65.1918 1386.2854,-72.5708 1384.9437,-62.0613 1378.6827,-65.1918\"/>\n</g>\n<!-- 010 -->\n<g id=\"node61\" class=\"node\">\n<title>010</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1539\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1539\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 210 -->\n<g id=\"node62\" class=\"node\">\n<title>210</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1539\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1539\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 010&#45;&gt;210 -->\n<g id=\"edge102\" class=\"edge\">\n<title>010&#45;&gt;210</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1533.0843,-216.2022C1532.2798,-208.1807 1532.0571,-198.5231 1532.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1535.9097,-189.8099 1533.105,-179.593 1528.9262,-189.3289 1535.9097,-189.8099\"/>\n</g>\n<!-- 110 -->\n<g id=\"node63\" class=\"node\">\n<title>110</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1467\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1467\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 010&#45;&gt;110 -->\n<g id=\"edge101\" class=\"edge\">\n<title>010&#45;&gt;110</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1523.7307,-218.7307C1513.803,-208.803 1500.6847,-195.6847 1489.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1491.7933,-181.8436 1482.2473,-177.2473 1486.8436,-186.7933 1491.7933,-181.8436\"/>\n</g>\n<!-- 210&#45;&gt;010 -->\n<g id=\"edge105\" class=\"edge\">\n<title>210&#45;&gt;010</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1544.895,-179.593C1545.7094,-187.5865 1545.942,-197.2363 1545.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1542.0976,-205.9891 1544.9157,-216.2022 1549.0817,-206.4608 1542.0976,-205.9891\"/>\n</g>\n<!-- 410 -->\n<g id=\"node64\" class=\"node\">\n<title>410</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1467\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1467\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 210&#45;&gt;410 -->\n<g id=\"edge106\" class=\"edge\">\n<title>210&#45;&gt;410</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1523.7307,-146.7307C1513.803,-136.803 1500.6847,-123.6847 1489.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1491.7933,-109.8436 1482.2473,-105.2473 1486.8436,-114.7933 1491.7933,-109.8436\"/>\n</g>\n<!-- 110&#45;&gt;210 -->\n<g id=\"edge103\" class=\"edge\">\n<title>110&#45;&gt;210</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1494,-162C1496.6147,-162 1499.2295,-162 1501.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1501.9297,-165.5001 1511.9297,-162 1501.9297,-158.5001 1501.9297,-165.5001\"/>\n</g>\n<!-- 110&#45;&gt;410 -->\n<g id=\"edge104\" class=\"edge\">\n<title>110&#45;&gt;410</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1467,-143.8314C1467,-136.131 1467,-126.9743 1467,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1470.5001,-118.4132 1467,-108.4133 1463.5001,-118.4133 1470.5001,-118.4132\"/>\n</g>\n<!-- 310 -->\n<g id=\"node65\" class=\"node\">\n<title>310</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1539\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1539\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 410&#45;&gt;310 -->\n<g id=\"edge108\" class=\"edge\">\n<title>410&#45;&gt;310</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1494,-90C1496.6147,-90 1499.2295,-90 1501.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1501.9297,-93.5001 1511.9297,-90 1501.9297,-86.5001 1501.9297,-93.5001\"/>\n</g>\n<!-- 510 -->\n<g id=\"node66\" class=\"node\">\n<title>510</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1530\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1530\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 410&#45;&gt;510 -->\n<g id=\"edge109\" class=\"edge\">\n<title>410&#45;&gt;510</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1480.6701,-74.3771C1489.1734,-64.659 1500.2613,-51.987 1509.7708,-41.1191\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1512.4056,-43.423 1516.3566,-33.5924 1507.1375,-38.8135 1512.4056,-43.423\"/>\n</g>\n<!-- 310&#45;&gt;110 -->\n<g id=\"edge107\" class=\"edge\">\n<title>310&#45;&gt;110</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1523.7527,-105.2473C1513.8297,-115.1703 1500.7123,-128.2877 1489.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1486.8656,-137.1847 1482.2693,-146.7307 1491.8153,-142.1344 1486.8656,-137.1847\"/>\n</g>\n<!-- 510&#45;&gt;310 -->\n<g id=\"edge110\" class=\"edge\">\n<title>510&#45;&gt;310</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1532.3017,-36.4133C1533.268,-44.1442 1534.4137,-53.3097 1535.4818,-61.8545\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1532.0155,-62.3427 1536.7289,-71.8314 1538.9615,-61.4744 1532.0155,-62.3427\"/>\n</g>\n<!-- 011 -->\n<g id=\"node67\" class=\"node\">\n<title>011</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1692\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1692\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 211 -->\n<g id=\"node68\" class=\"node\">\n<title>211</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1692\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1692\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 011&#45;&gt;211 -->\n<g id=\"edge112\" class=\"edge\">\n<title>011&#45;&gt;211</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1686.0843,-216.2022C1685.2798,-208.1807 1685.0571,-198.5231 1685.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1688.9097,-189.8099 1686.105,-179.593 1681.9262,-189.3289 1688.9097,-189.8099\"/>\n</g>\n<!-- 111 -->\n<g id=\"node69\" class=\"node\">\n<title>111</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1620\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1620\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 011&#45;&gt;111 -->\n<g id=\"edge111\" class=\"edge\">\n<title>011&#45;&gt;111</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1676.7307,-218.7307C1666.803,-208.803 1653.6847,-195.6847 1642.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1644.7933,-181.8436 1635.2473,-177.2473 1639.8436,-186.7933 1644.7933,-181.8436\"/>\n</g>\n<!-- 211&#45;&gt;011 -->\n<g id=\"edge115\" class=\"edge\">\n<title>211&#45;&gt;011</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1697.895,-179.593C1698.7094,-187.5865 1698.942,-197.2363 1698.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1695.0976,-205.9891 1697.9157,-216.2022 1702.0817,-206.4608 1695.0976,-205.9891\"/>\n</g>\n<!-- 411 -->\n<g id=\"node70\" class=\"node\">\n<title>411</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1620\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1620\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 211&#45;&gt;411 -->\n<g id=\"edge116\" class=\"edge\">\n<title>211&#45;&gt;411</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1676.7307,-146.7307C1666.803,-136.803 1653.6847,-123.6847 1642.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1644.7933,-109.8436 1635.2473,-105.2473 1639.8436,-114.7933 1644.7933,-109.8436\"/>\n</g>\n<!-- 111&#45;&gt;211 -->\n<g id=\"edge113\" class=\"edge\">\n<title>111&#45;&gt;211</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1647,-162C1649.6147,-162 1652.2295,-162 1654.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1654.9297,-165.5001 1664.9297,-162 1654.9297,-158.5001 1654.9297,-165.5001\"/>\n</g>\n<!-- 111&#45;&gt;411 -->\n<g id=\"edge114\" class=\"edge\">\n<title>111&#45;&gt;411</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1620,-143.8314C1620,-136.131 1620,-126.9743 1620,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1623.5001,-118.4132 1620,-108.4133 1616.5001,-118.4133 1623.5001,-118.4132\"/>\n</g>\n<!-- 311 -->\n<g id=\"node71\" class=\"node\">\n<title>311</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1692\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1692\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 411&#45;&gt;311 -->\n<g id=\"edge118\" class=\"edge\">\n<title>411&#45;&gt;311</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1647,-90C1649.6147,-90 1652.2295,-90 1654.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1654.9297,-93.5001 1664.9297,-90 1654.9297,-86.5001 1654.9297,-93.5001\"/>\n</g>\n<!-- 511 -->\n<g id=\"node72\" class=\"node\">\n<title>511</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1638\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1638\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 411&#45;&gt;511 -->\n<g id=\"edge119\" class=\"edge\">\n<title>411&#45;&gt;511</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1624.4494,-72.2022C1626.4398,-64.2406 1628.8332,-54.6671 1631.0511,-45.7957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1634.5094,-46.3929 1633.5394,-35.8425 1627.7184,-44.6951 1634.5094,-46.3929\"/>\n</g>\n<!-- 311&#45;&gt;111 -->\n<g id=\"edge117\" class=\"edge\">\n<title>311&#45;&gt;111</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1676.7527,-105.2473C1666.8297,-115.1703 1653.7123,-128.2877 1642.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1639.8656,-137.1847 1635.2693,-146.7307 1644.8153,-142.1344 1639.8656,-137.1847\"/>\n</g>\n<!-- 511&#45;&gt;311 -->\n<g id=\"edge120\" class=\"edge\">\n<title>511&#45;&gt;311</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1650.2049,-34.2733C1657.1005,-43.4673 1665.8586,-55.1448 1673.5743,-65.4324\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1670.9465,-67.7621 1679.7466,-73.6621 1676.5465,-63.5621 1670.9465,-67.7621\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":543}]},{"cell_type":"code","metadata":{"id":"WBFPoKth-Eui","colab":{"base_uri":"https://localhost:8080/","height":769},"executionInfo":{"status":"ok","timestamp":1577839693982,"user_tz":480,"elapsed":19009,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"77ef6b6b-6ac2-4ee8-a663-0ae3da4ac5e2"},"source":["# Classify edges\n","# edges is tree edge\n","# need to formulate better\n","'''\n","dcg[0] = [1, 2]\n","dcg[1] = [2, 4]\n","dcg[2] = [0, 4]\n","dcg[3] = [1]\n","dcg[4] = [3, 5]\n","dcg[5] = [3] # cross edge\n","'''\n","print(edges, back_edges)\n","tree = ft\n","tree_edges = edges\n","nodes = len(dcg)\n","new_edges, n_back_edges, forward_edges, cross_edges = [], [], [], []\n","# reversed tree:\n","reverse_tree = [[] for _ in range(nodes)]\n","for s in range(nodes):\n","  for e in tree[s]: \n","    reverse_tree[e].append(s)\n","for s in range(nodes):\n","  for e in dcg[s]:\n","    print(s, e, tree)\n","    if (s, e) in tree_edges:\n","      new_edges.append((s, e))\n","    elif bfgs(tree, e, s ):\n","      n_back_edges.append((s, e))\n","    elif bfgs(tree, s, e ):\n","      forward_edges.append((s ,e))\n","    else:\n","      cross_edges.append((s, e))\n","\n","edges_list = [new_edges, n_back_edges, forward_edges, cross_edges ]\n","dot = Digraph(comment='The Round Table', format='png')\n","print(edges_list)\n","rank1 = [0]\n","rank2 = [1]\n","rank2_1=[2]\n","rank3 = [4]\n","rank4 = [3, 5]\n","ranks = [rank1, rank2, rank2_1, rank3, rank4]\n","dot.attr(ranksep='0.75', rank='same')\n","\n","  \n","\n","colors = ['black', 'red', 'yellow', 'blue']\n","for i, edgesx in enumerate(edges_list):\n","  if not edgesx:\n","    continue\n","  for start, end in edgesx:\n","    if start is not None:\n","      dot.edge(str(start), str(end),_attributes={ 'color': colors[i]})\n","for i, rank in enumerate(ranks):\n","  with dot.subgraph(name=str(i)) as s:\n","    s.attr(ranksep='0.75', rank='same')\n","    for node in rank:\n","      s.node(name=str(node))\n","dot.render('test-output/depth_first_graph_search_edges', view=True, format='png') \n","#print(dot.source)\n","dot\n"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[(0, 1), (1, 2), (2, 4), (4, 3), (4, 5)] [(3, 4), (5, 4), (4, 2), (2, 1), (1, 0)]\n","0 1 [[1], [2], [4], [], [3, 5], []]\n","0 2 [[1], [2], [4], [], [3, 5], []]\n","1 2 [[1], [2], [4], [], [3, 5], []]\n","1 4 [[1], [2], [4], [], [3, 5], []]\n","2 0 [[1], [2], [4], [], [3, 5], []]\n","2 4 [[1], [2], [4], [], [3, 5], []]\n","3 1 [[1], [2], [4], [], [3, 5], []]\n","4 3 [[1], [2], [4], [], [3, 5], []]\n","4 5 [[1], [2], [4], [], [3, 5], []]\n","5 3 [[1], [2], [4], [], [3, 5], []]\n","[[(0, 1), (1, 2), (2, 4), (4, 3), (4, 5)], [(2, 0), (3, 1)], [(0, 2), (1, 4)], [(5, 3)]]\n"],"name":"stdout"},{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b63430f28>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"155pt\" height=\"404pt\"\n viewBox=\"0.00 0.00 155.00 404.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 400)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-400 151,-400 151,4 -4,4\"/>\n<!-- 0 -->\n<g id=\"node1\" class=\"node\">\n<title>0</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-378\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-374.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">0</text>\n</g>\n<!-- 1 -->\n<g id=\"node2\" class=\"node\">\n<title>1</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"91\" cy=\"-288\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"91\" y=\"-284.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">1</text>\n</g>\n<!-- 0&#45;&gt;1 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M38.7386,-361.4926C48.3917,-347.9179 62.2236,-328.4668 73.2329,-312.985\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"76.3929,-314.5807 79.3358,-304.4027 70.6882,-310.524 76.3929,-314.5807\"/>\n</g>\n<!-- 2 -->\n<g id=\"node3\" class=\"node\">\n<title>2</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"27\" cy=\"-198\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-194.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">2</text>\n</g>\n<!-- 0&#45;&gt;2 -->\n<g id=\"edge8\" class=\"edge\">\n<title>0&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#ffff00\" d=\"M22.7565,-360.0828C19.7126,-328.6803 19.4411,-263.4894 21.9419,-226.0586\"/>\n<polygon fill=\"#ffff00\" stroke=\"#ffff00\" points=\"25.4504,-226.0932 22.7636,-215.8447 18.4729,-225.5318 25.4504,-226.0932\"/>\n</g>\n<!-- 1&#45;&gt;2 -->\n<g id=\"edge2\" class=\"edge\">\n<title>1&#45;&gt;2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M79.2614,-271.4926C69.6083,-257.9179 55.7764,-238.4668 44.7671,-222.985\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"47.3118,-220.524 38.6642,-214.4027 41.6071,-224.5807 47.3118,-220.524\"/>\n</g>\n<!-- 4 -->\n<g id=\"node4\" class=\"node\">\n<title>4</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"56\" cy=\"-108\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"56\" y=\"-104.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">4</text>\n</g>\n<!-- 1&#45;&gt;4 -->\n<g id=\"edge9\" class=\"edge\">\n<title>1&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#ffff00\" d=\"M87.5161,-270.0828C81.4258,-238.7612 68.7993,-173.8252 61.5122,-136.3486\"/>\n<polygon fill=\"#ffff00\" stroke=\"#ffff00\" points=\"64.8662,-135.2599 59.5217,-126.1118 57.9949,-136.5961 64.8662,-135.2599\"/>\n</g>\n<!-- 2&#45;&gt;0 -->\n<g id=\"edge6\" class=\"edge\">\n<title>2&#45;&gt;0</title>\n<path fill=\"none\" stroke=\"#ff0000\" d=\"M31.2364,-215.8447C34.2846,-247.1952 34.5604,-312.3814 32.0638,-349.8549\"/>\n<polygon fill=\"#ff0000\" stroke=\"#ff0000\" points=\"28.5543,-349.835 31.2435,-360.0828 35.5319,-350.3947 28.5543,-349.835\"/>\n</g>\n<!-- 2&#45;&gt;4 -->\n<g id=\"edge3\" class=\"edge\">\n<title>2&#45;&gt;4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M32.7295,-180.2189C36.8603,-167.3991 42.5123,-149.8584 47.2116,-135.2742\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"50.5468,-136.3357 50.2824,-125.7442 43.8841,-134.1888 50.5468,-136.3357\"/>\n</g>\n<!-- 3 -->\n<g id=\"node5\" class=\"node\">\n<title>3</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"120\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"120\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">3</text>\n</g>\n<!-- 4&#45;&gt;3 -->\n<g id=\"edge4\" class=\"edge\">\n<title>4&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M67.7386,-91.4926C77.3917,-77.9179 91.2236,-58.4668 102.2329,-42.985\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"105.3929,-44.5807 108.3358,-34.4027 99.6882,-40.524 105.3929,-44.5807\"/>\n</g>\n<!-- 5 -->\n<g id=\"node6\" class=\"node\">\n<title>5</title>\n<ellipse fill=\"none\" stroke=\"#000000\" cx=\"48\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"48\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#000000\">5</text>\n</g>\n<!-- 4&#45;&gt;5 -->\n<g id=\"edge5\" class=\"edge\">\n<title>4&#45;&gt;5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54.3811,-89.7872C53.275,-77.3443 51.7871,-60.6053 50.5263,-46.4211\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"53.9883,-45.8366 49.6165,-36.1858 47.0157,-46.4564 53.9883,-45.8366\"/>\n</g>\n<!-- 3&#45;&gt;1 -->\n<g id=\"edge7\" class=\"edge\">\n<title>3&#45;&gt;1</title>\n<path fill=\"none\" stroke=\"#ff0000\" d=\"M118.0607,-36.0558C113.1172,-82.0815 100.0141,-204.0752 94.0425,-259.6732\"/>\n<polygon fill=\"#ff0000\" stroke=\"#ff0000\" points=\"90.5358,-259.5487 92.9478,-269.8653 97.4958,-260.2963 90.5358,-259.5487\"/>\n</g>\n<!-- 5&#45;&gt;3 -->\n<g id=\"edge10\" class=\"edge\">\n<title>5&#45;&gt;3</title>\n<path fill=\"none\" stroke=\"#0000ff\" d=\"M75,-18C77.6147,-18 80.2295,-18 82.8442,-18\"/>\n<polygon fill=\"#0000ff\" stroke=\"#0000ff\" points=\"82.9297,-21.5001 92.9297,-18 82.9297,-14.5001 82.9297,-21.5001\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":544}]},{"cell_type":"markdown","metadata":{"id":"fSCrzb82GPUy"},"source":["More about the application of classificatio of edges. "]},{"cell_type":"markdown","metadata":{"id":"XIfzSpwDYZON"},"source":["Discover and finish time"]},{"cell_type":"code","metadata":{"id":"XmsNF54Gd0rN"},"source":["#Discovering and finishing time\n","def dfs(g, s, colors):\n","  dfs.t += 1 # static variable\n","  colors[s] = STATE.gray\n","  dfs.discover[s] = dfs.t\n","  for v in g[s]:\n","    if colors[v] == STATE.white:\n","      dfs(g, v, colors)\n","  # complete\n","  dfs.t += 1\n","  dfs.finish[s] = dfs.t\n","  return"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"4U0E0RQfeKkh","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839693988,"user_tz":480,"elapsed":18995,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"43996495-b35e-4dc9-f5c8-34830552c240"},"source":["v = len(dcg)\n","colors = [STATE.white] * v\n","dfs.t = -1\n","dfs.discover, dfs.finish = [-1] * v, [-1] * v\n","dfs(dcg,0, colors)\n","dfs.discover, dfs.finish"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([0, 1, 2, 4, 3, 6], [11, 10, 9, 5, 8, 7])"]},"metadata":{"tags":[]},"execution_count":546}]},{"cell_type":"code","metadata":{"id":"Q3qw9TVueO4r"},"source":["def parenthesis(dt, ft, n):\n","  merge_orders = [-1] * 2 * n\n","  for v, t in enumerate(dt):\n","    merge_orders[t] = v\n","  for v, t in enumerate(ft):\n","    merge_orders[t] = v\n","\n","  print(merge_orders)\n","  nodes = set()\n","  for i in merge_orders:\n","    if i not in nodes:\n","      print('(', i, end = ', ')\n","      nodes.add(i)\n","    else:\n","      print(i, '),', end = ' ')"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"bsZ4WOk3e4OT","colab":{"base_uri":"https://localhost:8080/","height":52},"executionInfo":{"status":"ok","timestamp":1577839694207,"user_tz":480,"elapsed":19193,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"6460ea8f-3334-444f-d6ce-cbc0b389c90a"},"source":["parenthesis(dfs.discover, dfs.finish, v)"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[0, 1, 2, 4, 3, 3, 5, 5, 4, 2, 1, 0]\n","( 0, ( 1, ( 2, ( 4, ( 3, 3 ), ( 5, 5 ), 4 ), 2 ), 1 ), 0 ), "],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"qRdHVeAG9z29"},"source":["### Iterative Implementation ***"]},{"cell_type":"code","metadata":{"id":"xT0mVw8gZTIi"},"source":["#Iterative implementation with three states\n","def dftIter(g, s):\n","  '''not preserving the same discovery ordering'''\n","  n = len(g)\n","  orders = []\n","  colors = [STATE.white] * n\n","  stack = [s]\n","\n","  orders.append(s) # track gray order\n","  colors[s] = STATE.gray\n","        \n","  while stack:\n","    u = stack.pop()\n","    \n","    for v in g[u]:\n","      if colors[v] == STATE.white:\n","        colors[v] = STATE.gray\n","        stack.append(v)\n","        orders.append(v) # track gray order\n","    \n","  return orders"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"q3hq9ARKqqnw","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839694212,"user_tz":480,"elapsed":19176,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"3d0b9d01-b012-4794-af03-042a1e5512ce"},"source":["# initialization\n","'''start from 0'''\n","print(dftIter(ucg,0))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[0, 1, 2, 4, 3, 5]\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"RIVOD221rHii","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839694216,"user_tz":480,"elapsed":19166,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"9f6a74e9-769b-405c-b518-b88d2c9eeae2"},"source":["print(dftIter(ucg, 1))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[1, 0, 2, 3, 4, 5]\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"I4eVWYzGj01U"},"source":["def dftIter(g, s):\n","  '''preserving only discovery ordering'''\n","  n = len(g)\n","  orders = []\n","  colors = [STATE.white] * n\n","  stack = [s]\n","\n","  #orders.append(s) # track gray order\n","  #colors[s] = STATE.gray\n","        \n","  while stack:\n","    u = stack.pop()\n","    if colors[u] == STATE.white:\n","      orders.append(u) # track gray order\n","    colors[u] = STATE.gray\n","    for v in g[u][::-1]:\n","      if colors[v] == STATE.white:\n","        \n","        stack.append(v)\n","        #orders.append(v) # track gray order\n","    \n","  return orders"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"5JWNwi9rlAER","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839694223,"user_tz":480,"elapsed":19153,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"61c6eca2-9dcd-4b23-ebe0-fe7fae0ba312"},"source":["print(dftIter(ucg, 0))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[0, 1, 2, 4, 3, 5]\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"mBqP-iy9ma3d","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839694229,"user_tz":480,"elapsed":19145,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"dbad8a60-6b64-432b-e053-ab3aade53a5a"},"source":["print(dftIter(ucg, 1))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["[1, 0, 2, 4, 3, 5]\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"id":"rrFl2gwokZON"},"source":["def dfsIter(g, s):\n","  '''iterative dfs'''\n","  v = len(g)\n","  orders, complete_orders = [], []\n","  colors = [STATE.white] * v\n","  stack = [s]\n","\n","  orders.append(s) # track gray order\n","  colors[s] = STATE.gray\n","        \n","  while stack:\n","    u = stack[-1]\n","    bAdj = False\n","    for v in g[u]:\n","      if colors[v] == STATE.white:\n","        colors[v] = STATE.gray\n","        stack.append(v)\n","        orders.append(v) # track gray order\n","        bAdj = True\n","        break\n","     \n","    if not bAdj: # if no adjacent is found, pop out\n","      # complete\n","      colors[u] = STATE.black # this is not necessary in the code, just to help track the state\n","      complete_orders.append(u)\n","      stack.pop()\n","    \n","  return orders, complete_orders       "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"vGaO1vCbly-a","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839694502,"user_tz":480,"elapsed":19399,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"5f6a1035-9b9f-40dd-be46-34686fdb9534"},"source":["print(dfsIter(ucg, 0))"],"execution_count":null,"outputs":[{"output_type":"stream","text":["([0, 1, 2, 4, 3, 5], [3, 5, 4, 2, 1, 0])\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"oAxBg1ZR-ct5"},"source":["## Breath-first Graph Search"]},{"cell_type":"code","metadata":{"id":"aR60hTwOQOo0"},"source":["def bfgs_state(g, s):\n","  v = len(g)\n","  colors = [STATE.white] * v\n","  \n","  q, orders = [s], [s]\n","  complete_orders = []\n","  colors[s] = STATE.gray # make the state of the visiting node\n","  while q:\n","    u = q.pop(0)   \n","    for v in g[u]:\n","      if colors[v] == STATE.white:\n","        colors[v] = STATE.gray\n","        q.append(v)\n","        orders.append(v)\n","\n","    # complete \n","    colors[u] = STATE.black\n","    complete_orders.append(u)\n","  return orders, complete_orders"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"Ld25XyC8Uxun","colab":{"base_uri":"https://localhost:8080/","height":34},"executionInfo":{"status":"ok","timestamp":1577839694506,"user_tz":480,"elapsed":19381,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"539d70aa-6c17-48b1-b328-6a9aa97b4649"},"source":["bfgs_state(dcg, 0)"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["([0, 1, 2, 4, 3, 5], [0, 1, 2, 4, 3, 5])"]},"metadata":{"tags":[]},"execution_count":558}]},{"cell_type":"code","metadata":{"id":"GxtnwF3_XN1F"},"source":["# Plot state\n","def plot_state_bfs(g, colors,  dot, png_name):\n","  #dot = Digraph(comment='The Round Table', format='png')\n","  #name = str(next(counter))\n","  with dot.subgraph(name=png_name) as init:\n","    nodes = len(g)\n","    rank1 = [0]\n","    rank2 = [2, 1]\n","    rank3 = [4, 3]\n","    rank4 = [5]\n","    ranks = [rank1, rank2, rank3, rank4]\n","   \n","    for i, rank in enumerate(ranks):\n","      subgraph_name = png_name + str(i)\n","      with init.subgraph() as s:\n","        s.attr(rank='same')\n","        for node in rank:\n","          \n","          if colors[node] == STATE.gray:\n","            set_node_style(s, 'gray', node, name=str(node)+png_name)\n","          elif colors[node] == STATE.black:\n","            set_node_style(s, 'black', node, name=str(node)+png_name)\n","          else:\n","            set_node_style(s, 'white', node, name=str(node)+png_name)\n","      # \n","    for s in range(nodes):\n","      for e in g[s]:\n","        init.edge(str(s)+png_name, str(e)+png_name)\n","    init.render('test-output/'+png_name, view=True, format='png') "],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"sFud8KIWVZka"},"source":["def bfgs_state_plot(g, s):\n","  v = len(g)\n","  colors = [STATE.white] * v\n","\n","  dot = Digraph(comment='The Round Table', format='png')\n","\n","  \n","  q = [s]\n","  colors[s] = STATE.gray # make the state of the visiting node\n","  counter = itertools.count()\n","  plot_state_bfs(g, colors,  dot, png_name='breath_first_graph_search_process'+str(next(counter)))\n","  while q:\n","    u = q.pop(0)   \n","    for v in g[u]:\n","      if colors[v] == STATE.white:\n","        colors[v] = STATE.gray\n","        q.append(v)\n","        plot_state_bfs(g, colors,  dot, png_name='breath_first_graph_search_process'+str(next(counter)))\n","\n","    # complete \n","    colors[u] = STATE.black\n","    plot_state_bfs(g, colors,  dot, png_name='breath_first_graph_search_process'+str(next(counter)))\n","  #dot.render('test-output/breath_first_graph_search_process', view=True) \n","  return dot\n"],"execution_count":null,"outputs":[]},{"cell_type":"code","metadata":{"id":"b6C9AhL5WCPH","colab":{"base_uri":"https://localhost:8080/","height":389},"executionInfo":{"status":"ok","timestamp":1577839695426,"user_tz":480,"elapsed":20268,"user":{"displayName":"Li Yin","photoUrl":"https://lh3.googleusercontent.com/a-/AAuE7mDHkgtY8ax6h1ZXf46S1b3QtrhKej1YjeAjlwhj5w=s64","userId":"13365523799853678553"}},"outputId":"82ca88fe-7e9e-40b8-ac00-1af9dc05b62a"},"source":["dot = bfgs_state_plot(dcg, 0)\n","dot"],"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["<graphviz.dot.Digraph at 0x7f6b6347cf98>"],"image/svg+xml":"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Generated by graphviz version 2.40.1 (20161225.0304)\n -->\n<!-- Title: %3 Pages: 1 -->\n<svg width=\"1727pt\" height=\"260pt\"\n viewBox=\"0.00 0.00 1727.00 260.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 256)\">\n<title>%3</title>\n<polygon fill=\"#ffffff\" stroke=\"transparent\" points=\"-4,4 -4,-256 1723,-256 1723,4 -4,4\"/>\n<!-- 0breath_first_graph_search_process0 -->\n<g id=\"node1\" class=\"node\">\n<title>0breath_first_graph_search_process0</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"99\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process0 -->\n<g id=\"node2\" class=\"node\">\n<title>2breath_first_graph_search_process0</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"99\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process0&#45;&gt;2breath_first_graph_search_process0 -->\n<g id=\"edge2\" class=\"edge\">\n<title>0breath_first_graph_search_process0&#45;&gt;2breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M93.0843,-216.2022C92.2798,-208.1807 92.0571,-198.5231 92.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"95.9097,-189.8099 93.105,-179.593 88.9262,-189.3289 95.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process0 -->\n<g id=\"node3\" class=\"node\">\n<title>1breath_first_graph_search_process0</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"27\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process0&#45;&gt;1breath_first_graph_search_process0 -->\n<g id=\"edge1\" class=\"edge\">\n<title>0breath_first_graph_search_process0&#45;&gt;1breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-218.7307C73.803,-208.803 60.6847,-195.6847 49.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-181.8436 42.2473,-177.2473 46.8436,-186.7933 51.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process0&#45;&gt;0breath_first_graph_search_process0 -->\n<g id=\"edge5\" class=\"edge\">\n<title>2breath_first_graph_search_process0&#45;&gt;0breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M104.895,-179.593C105.7094,-187.5865 105.942,-197.2363 105.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"102.0976,-205.9891 104.9157,-216.2022 109.0817,-206.4608 102.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process0 -->\n<g id=\"node4\" class=\"node\">\n<title>4breath_first_graph_search_process0</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"27\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"27\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process0&#45;&gt;4breath_first_graph_search_process0 -->\n<g id=\"edge6\" class=\"edge\">\n<title>2breath_first_graph_search_process0&#45;&gt;4breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7307,-146.7307C73.803,-136.803 60.6847,-123.6847 49.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"51.7933,-109.8436 42.2473,-105.2473 46.8436,-114.7933 51.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process0&#45;&gt;2breath_first_graph_search_process0 -->\n<g id=\"edge3\" class=\"edge\">\n<title>1breath_first_graph_search_process0&#45;&gt;2breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-162C56.6147,-162 59.2295,-162 61.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-165.5001 71.9297,-162 61.9297,-158.5001 61.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process0&#45;&gt;4breath_first_graph_search_process0 -->\n<g id=\"edge4\" class=\"edge\">\n<title>1breath_first_graph_search_process0&#45;&gt;4breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M27,-143.8314C27,-136.131 27,-126.9743 27,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"30.5001,-118.4132 27,-108.4133 23.5001,-118.4133 30.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process0 -->\n<g id=\"node5\" class=\"node\">\n<title>3breath_first_graph_search_process0</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"99\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"99\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process0&#45;&gt;3breath_first_graph_search_process0 -->\n<g id=\"edge8\" class=\"edge\">\n<title>4breath_first_graph_search_process0&#45;&gt;3breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M54,-90C56.6147,-90 59.2295,-90 61.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"61.9297,-93.5001 71.9297,-90 61.9297,-86.5001 61.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process0 -->\n<g id=\"node6\" class=\"node\">\n<title>5breath_first_graph_search_process0</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"63\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"63\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process0&#45;&gt;5breath_first_graph_search_process0 -->\n<g id=\"edge9\" class=\"edge\">\n<title>4breath_first_graph_search_process0&#45;&gt;5breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M35.7146,-72.5708C39.9597,-64.0807 45.1536,-53.6929 49.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"53.024,-45.7782 54.3657,-35.2687 46.763,-42.6477 53.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process0&#45;&gt;1breath_first_graph_search_process0 -->\n<g id=\"edge7\" class=\"edge\">\n<title>3breath_first_graph_search_process0&#45;&gt;1breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M83.7527,-105.2473C73.8297,-115.1703 60.7123,-128.2877 49.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"46.8656,-137.1847 42.2693,-146.7307 51.8153,-142.1344 46.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process0&#45;&gt;3breath_first_graph_search_process0 -->\n<g id=\"edge10\" class=\"edge\">\n<title>5breath_first_graph_search_process0&#45;&gt;3breath_first_graph_search_process0</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M71.6343,-35.2687C75.8674,-43.7348 81.0583,-54.1166 85.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"82.6827,-65.1918 90.2854,-72.5708 88.9437,-62.0613 82.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process1 -->\n<g id=\"node7\" class=\"node\">\n<title>0breath_first_graph_search_process1</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"243\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"243\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process1 -->\n<g id=\"node8\" class=\"node\">\n<title>2breath_first_graph_search_process1</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"243\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"243\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process1&#45;&gt;2breath_first_graph_search_process1 -->\n<g id=\"edge12\" class=\"edge\">\n<title>0breath_first_graph_search_process1&#45;&gt;2breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M237.0843,-216.2022C236.2798,-208.1807 236.0571,-198.5231 236.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"239.9097,-189.8099 237.105,-179.593 232.9262,-189.3289 239.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process1 -->\n<g id=\"node9\" class=\"node\">\n<title>1breath_first_graph_search_process1</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"171\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"171\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process1&#45;&gt;1breath_first_graph_search_process1 -->\n<g id=\"edge11\" class=\"edge\">\n<title>0breath_first_graph_search_process1&#45;&gt;1breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M227.7307,-218.7307C217.803,-208.803 204.6847,-195.6847 193.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.7933,-181.8436 186.2473,-177.2473 190.8436,-186.7933 195.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process1&#45;&gt;0breath_first_graph_search_process1 -->\n<g id=\"edge15\" class=\"edge\">\n<title>2breath_first_graph_search_process1&#45;&gt;0breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M248.895,-179.593C249.7094,-187.5865 249.942,-197.2363 249.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"246.0976,-205.9891 248.9157,-216.2022 253.0817,-206.4608 246.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process1 -->\n<g id=\"node10\" class=\"node\">\n<title>4breath_first_graph_search_process1</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"171\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"171\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process1&#45;&gt;4breath_first_graph_search_process1 -->\n<g id=\"edge16\" class=\"edge\">\n<title>2breath_first_graph_search_process1&#45;&gt;4breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M227.7307,-146.7307C217.803,-136.803 204.6847,-123.6847 193.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"195.7933,-109.8436 186.2473,-105.2473 190.8436,-114.7933 195.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process1&#45;&gt;2breath_first_graph_search_process1 -->\n<g id=\"edge13\" class=\"edge\">\n<title>1breath_first_graph_search_process1&#45;&gt;2breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M198,-162C200.6147,-162 203.2295,-162 205.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"205.9297,-165.5001 215.9297,-162 205.9297,-158.5001 205.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process1&#45;&gt;4breath_first_graph_search_process1 -->\n<g id=\"edge14\" class=\"edge\">\n<title>1breath_first_graph_search_process1&#45;&gt;4breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M171,-143.8314C171,-136.131 171,-126.9743 171,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"174.5001,-118.4132 171,-108.4133 167.5001,-118.4133 174.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process1 -->\n<g id=\"node11\" class=\"node\">\n<title>3breath_first_graph_search_process1</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"243\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"243\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process1&#45;&gt;3breath_first_graph_search_process1 -->\n<g id=\"edge18\" class=\"edge\">\n<title>4breath_first_graph_search_process1&#45;&gt;3breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M198,-90C200.6147,-90 203.2295,-90 205.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"205.9297,-93.5001 215.9297,-90 205.9297,-86.5001 205.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process1 -->\n<g id=\"node12\" class=\"node\">\n<title>5breath_first_graph_search_process1</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"207\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"207\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process1&#45;&gt;5breath_first_graph_search_process1 -->\n<g id=\"edge19\" class=\"edge\">\n<title>4breath_first_graph_search_process1&#45;&gt;5breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M179.7146,-72.5708C183.9597,-64.0807 189.1536,-53.6929 193.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"197.024,-45.7782 198.3657,-35.2687 190.763,-42.6477 197.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process1&#45;&gt;1breath_first_graph_search_process1 -->\n<g id=\"edge17\" class=\"edge\">\n<title>3breath_first_graph_search_process1&#45;&gt;1breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M227.7527,-105.2473C217.8297,-115.1703 204.7123,-128.2877 193.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"190.8656,-137.1847 186.2693,-146.7307 195.8153,-142.1344 190.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process1&#45;&gt;3breath_first_graph_search_process1 -->\n<g id=\"edge20\" class=\"edge\">\n<title>5breath_first_graph_search_process1&#45;&gt;3breath_first_graph_search_process1</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M215.6343,-35.2687C219.8674,-43.7348 225.0583,-54.1166 229.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"226.6827,-65.1918 234.2854,-72.5708 232.9437,-62.0613 226.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process2 -->\n<g id=\"node13\" class=\"node\">\n<title>0breath_first_graph_search_process2</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"387\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process2 -->\n<g id=\"node14\" class=\"node\">\n<title>2breath_first_graph_search_process2</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"387\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process2&#45;&gt;2breath_first_graph_search_process2 -->\n<g id=\"edge22\" class=\"edge\">\n<title>0breath_first_graph_search_process2&#45;&gt;2breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M381.0843,-216.2022C380.2798,-208.1807 380.0571,-198.5231 380.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"383.9097,-189.8099 381.105,-179.593 376.9262,-189.3289 383.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process2 -->\n<g id=\"node15\" class=\"node\">\n<title>1breath_first_graph_search_process2</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"315\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process2&#45;&gt;1breath_first_graph_search_process2 -->\n<g id=\"edge21\" class=\"edge\">\n<title>0breath_first_graph_search_process2&#45;&gt;1breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M371.7307,-218.7307C361.803,-208.803 348.6847,-195.6847 337.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"339.7933,-181.8436 330.2473,-177.2473 334.8436,-186.7933 339.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process2&#45;&gt;0breath_first_graph_search_process2 -->\n<g id=\"edge25\" class=\"edge\">\n<title>2breath_first_graph_search_process2&#45;&gt;0breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M392.895,-179.593C393.7094,-187.5865 393.942,-197.2363 393.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"390.0976,-205.9891 392.9157,-216.2022 397.0817,-206.4608 390.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process2 -->\n<g id=\"node16\" class=\"node\">\n<title>4breath_first_graph_search_process2</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"315\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"315\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process2&#45;&gt;4breath_first_graph_search_process2 -->\n<g id=\"edge26\" class=\"edge\">\n<title>2breath_first_graph_search_process2&#45;&gt;4breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M371.7307,-146.7307C361.803,-136.803 348.6847,-123.6847 337.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"339.7933,-109.8436 330.2473,-105.2473 334.8436,-114.7933 339.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process2&#45;&gt;2breath_first_graph_search_process2 -->\n<g id=\"edge23\" class=\"edge\">\n<title>1breath_first_graph_search_process2&#45;&gt;2breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M342,-162C344.6147,-162 347.2295,-162 349.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"349.9297,-165.5001 359.9297,-162 349.9297,-158.5001 349.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process2&#45;&gt;4breath_first_graph_search_process2 -->\n<g id=\"edge24\" class=\"edge\">\n<title>1breath_first_graph_search_process2&#45;&gt;4breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M315,-143.8314C315,-136.131 315,-126.9743 315,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"318.5001,-118.4132 315,-108.4133 311.5001,-118.4133 318.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process2 -->\n<g id=\"node17\" class=\"node\">\n<title>3breath_first_graph_search_process2</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"387\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"387\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process2&#45;&gt;3breath_first_graph_search_process2 -->\n<g id=\"edge28\" class=\"edge\">\n<title>4breath_first_graph_search_process2&#45;&gt;3breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M342,-90C344.6147,-90 347.2295,-90 349.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"349.9297,-93.5001 359.9297,-90 349.9297,-86.5001 349.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process2 -->\n<g id=\"node18\" class=\"node\">\n<title>5breath_first_graph_search_process2</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"351\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"351\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process2&#45;&gt;5breath_first_graph_search_process2 -->\n<g id=\"edge29\" class=\"edge\">\n<title>4breath_first_graph_search_process2&#45;&gt;5breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M323.7146,-72.5708C327.9597,-64.0807 333.1536,-53.6929 337.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"341.024,-45.7782 342.3657,-35.2687 334.763,-42.6477 341.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process2&#45;&gt;1breath_first_graph_search_process2 -->\n<g id=\"edge27\" class=\"edge\">\n<title>3breath_first_graph_search_process2&#45;&gt;1breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M371.7527,-105.2473C361.8297,-115.1703 348.7123,-128.2877 337.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"334.8656,-137.1847 330.2693,-146.7307 339.8153,-142.1344 334.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process2&#45;&gt;3breath_first_graph_search_process2 -->\n<g id=\"edge30\" class=\"edge\">\n<title>5breath_first_graph_search_process2&#45;&gt;3breath_first_graph_search_process2</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M359.6343,-35.2687C363.8674,-43.7348 369.0583,-54.1166 373.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"370.6827,-65.1918 378.2854,-72.5708 376.9437,-62.0613 370.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process3 -->\n<g id=\"node19\" class=\"node\">\n<title>0breath_first_graph_search_process3</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"531\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"531\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process3 -->\n<g id=\"node20\" class=\"node\">\n<title>2breath_first_graph_search_process3</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"531\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"531\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process3&#45;&gt;2breath_first_graph_search_process3 -->\n<g id=\"edge32\" class=\"edge\">\n<title>0breath_first_graph_search_process3&#45;&gt;2breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M525.0843,-216.2022C524.2798,-208.1807 524.0571,-198.5231 524.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"527.9097,-189.8099 525.105,-179.593 520.9262,-189.3289 527.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process3 -->\n<g id=\"node21\" class=\"node\">\n<title>1breath_first_graph_search_process3</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"459\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"459\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process3&#45;&gt;1breath_first_graph_search_process3 -->\n<g id=\"edge31\" class=\"edge\">\n<title>0breath_first_graph_search_process3&#45;&gt;1breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M515.7307,-218.7307C505.803,-208.803 492.6847,-195.6847 481.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"483.7933,-181.8436 474.2473,-177.2473 478.8436,-186.7933 483.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process3&#45;&gt;0breath_first_graph_search_process3 -->\n<g id=\"edge35\" class=\"edge\">\n<title>2breath_first_graph_search_process3&#45;&gt;0breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M536.895,-179.593C537.7094,-187.5865 537.942,-197.2363 537.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"534.0976,-205.9891 536.9157,-216.2022 541.0817,-206.4608 534.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process3 -->\n<g id=\"node22\" class=\"node\">\n<title>4breath_first_graph_search_process3</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"459\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"459\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process3&#45;&gt;4breath_first_graph_search_process3 -->\n<g id=\"edge36\" class=\"edge\">\n<title>2breath_first_graph_search_process3&#45;&gt;4breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M515.7307,-146.7307C505.803,-136.803 492.6847,-123.6847 481.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"483.7933,-109.8436 474.2473,-105.2473 478.8436,-114.7933 483.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process3&#45;&gt;2breath_first_graph_search_process3 -->\n<g id=\"edge33\" class=\"edge\">\n<title>1breath_first_graph_search_process3&#45;&gt;2breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M486,-162C488.6147,-162 491.2295,-162 493.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"493.9297,-165.5001 503.9297,-162 493.9297,-158.5001 493.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process3&#45;&gt;4breath_first_graph_search_process3 -->\n<g id=\"edge34\" class=\"edge\">\n<title>1breath_first_graph_search_process3&#45;&gt;4breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M459,-143.8314C459,-136.131 459,-126.9743 459,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"462.5001,-118.4132 459,-108.4133 455.5001,-118.4133 462.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process3 -->\n<g id=\"node23\" class=\"node\">\n<title>3breath_first_graph_search_process3</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"531\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"531\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process3&#45;&gt;3breath_first_graph_search_process3 -->\n<g id=\"edge38\" class=\"edge\">\n<title>4breath_first_graph_search_process3&#45;&gt;3breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M486,-90C488.6147,-90 491.2295,-90 493.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"493.9297,-93.5001 503.9297,-90 493.9297,-86.5001 493.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process3 -->\n<g id=\"node24\" class=\"node\">\n<title>5breath_first_graph_search_process3</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"495\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"495\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process3&#45;&gt;5breath_first_graph_search_process3 -->\n<g id=\"edge39\" class=\"edge\">\n<title>4breath_first_graph_search_process3&#45;&gt;5breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M467.7146,-72.5708C471.9597,-64.0807 477.1536,-53.6929 481.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"485.024,-45.7782 486.3657,-35.2687 478.763,-42.6477 485.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process3&#45;&gt;1breath_first_graph_search_process3 -->\n<g id=\"edge37\" class=\"edge\">\n<title>3breath_first_graph_search_process3&#45;&gt;1breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M515.7527,-105.2473C505.8297,-115.1703 492.7123,-128.2877 481.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"478.8656,-137.1847 474.2693,-146.7307 483.8153,-142.1344 478.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process3&#45;&gt;3breath_first_graph_search_process3 -->\n<g id=\"edge40\" class=\"edge\">\n<title>5breath_first_graph_search_process3&#45;&gt;3breath_first_graph_search_process3</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M503.6343,-35.2687C507.8674,-43.7348 513.0583,-54.1166 517.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"514.6827,-65.1918 522.2854,-72.5708 520.9437,-62.0613 514.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process4 -->\n<g id=\"node25\" class=\"node\">\n<title>0breath_first_graph_search_process4</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"675\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"675\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process4 -->\n<g id=\"node26\" class=\"node\">\n<title>2breath_first_graph_search_process4</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"675\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"675\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process4&#45;&gt;2breath_first_graph_search_process4 -->\n<g id=\"edge42\" class=\"edge\">\n<title>0breath_first_graph_search_process4&#45;&gt;2breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M669.0843,-216.2022C668.2798,-208.1807 668.0571,-198.5231 668.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"671.9097,-189.8099 669.105,-179.593 664.9262,-189.3289 671.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process4 -->\n<g id=\"node27\" class=\"node\">\n<title>1breath_first_graph_search_process4</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"603\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"603\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process4&#45;&gt;1breath_first_graph_search_process4 -->\n<g id=\"edge41\" class=\"edge\">\n<title>0breath_first_graph_search_process4&#45;&gt;1breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M659.7307,-218.7307C649.803,-208.803 636.6847,-195.6847 625.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"627.7933,-181.8436 618.2473,-177.2473 622.8436,-186.7933 627.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process4&#45;&gt;0breath_first_graph_search_process4 -->\n<g id=\"edge45\" class=\"edge\">\n<title>2breath_first_graph_search_process4&#45;&gt;0breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M680.895,-179.593C681.7094,-187.5865 681.942,-197.2363 681.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"678.0976,-205.9891 680.9157,-216.2022 685.0817,-206.4608 678.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process4 -->\n<g id=\"node28\" class=\"node\">\n<title>4breath_first_graph_search_process4</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"603\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"603\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process4&#45;&gt;4breath_first_graph_search_process4 -->\n<g id=\"edge46\" class=\"edge\">\n<title>2breath_first_graph_search_process4&#45;&gt;4breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M659.7307,-146.7307C649.803,-136.803 636.6847,-123.6847 625.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"627.7933,-109.8436 618.2473,-105.2473 622.8436,-114.7933 627.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process4&#45;&gt;2breath_first_graph_search_process4 -->\n<g id=\"edge43\" class=\"edge\">\n<title>1breath_first_graph_search_process4&#45;&gt;2breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M630,-162C632.6147,-162 635.2295,-162 637.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"637.9297,-165.5001 647.9297,-162 637.9297,-158.5001 637.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process4&#45;&gt;4breath_first_graph_search_process4 -->\n<g id=\"edge44\" class=\"edge\">\n<title>1breath_first_graph_search_process4&#45;&gt;4breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M603,-143.8314C603,-136.131 603,-126.9743 603,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"606.5001,-118.4132 603,-108.4133 599.5001,-118.4133 606.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process4 -->\n<g id=\"node29\" class=\"node\">\n<title>3breath_first_graph_search_process4</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"675\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"675\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process4&#45;&gt;3breath_first_graph_search_process4 -->\n<g id=\"edge48\" class=\"edge\">\n<title>4breath_first_graph_search_process4&#45;&gt;3breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M630,-90C632.6147,-90 635.2295,-90 637.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"637.9297,-93.5001 647.9297,-90 637.9297,-86.5001 637.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process4 -->\n<g id=\"node30\" class=\"node\">\n<title>5breath_first_graph_search_process4</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"639\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"639\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process4&#45;&gt;5breath_first_graph_search_process4 -->\n<g id=\"edge49\" class=\"edge\">\n<title>4breath_first_graph_search_process4&#45;&gt;5breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M611.7146,-72.5708C615.9597,-64.0807 621.1536,-53.6929 625.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"629.024,-45.7782 630.3657,-35.2687 622.763,-42.6477 629.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process4&#45;&gt;1breath_first_graph_search_process4 -->\n<g id=\"edge47\" class=\"edge\">\n<title>3breath_first_graph_search_process4&#45;&gt;1breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M659.7527,-105.2473C649.8297,-115.1703 636.7123,-128.2877 625.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"622.8656,-137.1847 618.2693,-146.7307 627.8153,-142.1344 622.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process4&#45;&gt;3breath_first_graph_search_process4 -->\n<g id=\"edge50\" class=\"edge\">\n<title>5breath_first_graph_search_process4&#45;&gt;3breath_first_graph_search_process4</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M647.6343,-35.2687C651.8674,-43.7348 657.0583,-54.1166 661.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"658.6827,-65.1918 666.2854,-72.5708 664.9437,-62.0613 658.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process5 -->\n<g id=\"node31\" class=\"node\">\n<title>0breath_first_graph_search_process5</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"819\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"819\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process5 -->\n<g id=\"node32\" class=\"node\">\n<title>2breath_first_graph_search_process5</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"819\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"819\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process5&#45;&gt;2breath_first_graph_search_process5 -->\n<g id=\"edge52\" class=\"edge\">\n<title>0breath_first_graph_search_process5&#45;&gt;2breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M813.0843,-216.2022C812.2798,-208.1807 812.0571,-198.5231 812.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"815.9097,-189.8099 813.105,-179.593 808.9262,-189.3289 815.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process5 -->\n<g id=\"node33\" class=\"node\">\n<title>1breath_first_graph_search_process5</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"747\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"747\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process5&#45;&gt;1breath_first_graph_search_process5 -->\n<g id=\"edge51\" class=\"edge\">\n<title>0breath_first_graph_search_process5&#45;&gt;1breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M803.7307,-218.7307C793.803,-208.803 780.6847,-195.6847 769.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"771.7933,-181.8436 762.2473,-177.2473 766.8436,-186.7933 771.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process5&#45;&gt;0breath_first_graph_search_process5 -->\n<g id=\"edge55\" class=\"edge\">\n<title>2breath_first_graph_search_process5&#45;&gt;0breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M824.895,-179.593C825.7094,-187.5865 825.942,-197.2363 825.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"822.0976,-205.9891 824.9157,-216.2022 829.0817,-206.4608 822.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process5 -->\n<g id=\"node34\" class=\"node\">\n<title>4breath_first_graph_search_process5</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"747\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"747\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process5&#45;&gt;4breath_first_graph_search_process5 -->\n<g id=\"edge56\" class=\"edge\">\n<title>2breath_first_graph_search_process5&#45;&gt;4breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M803.7307,-146.7307C793.803,-136.803 780.6847,-123.6847 769.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"771.7933,-109.8436 762.2473,-105.2473 766.8436,-114.7933 771.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process5&#45;&gt;2breath_first_graph_search_process5 -->\n<g id=\"edge53\" class=\"edge\">\n<title>1breath_first_graph_search_process5&#45;&gt;2breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M774,-162C776.6147,-162 779.2295,-162 781.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"781.9297,-165.5001 791.9297,-162 781.9297,-158.5001 781.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process5&#45;&gt;4breath_first_graph_search_process5 -->\n<g id=\"edge54\" class=\"edge\">\n<title>1breath_first_graph_search_process5&#45;&gt;4breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M747,-143.8314C747,-136.131 747,-126.9743 747,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"750.5001,-118.4132 747,-108.4133 743.5001,-118.4133 750.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process5 -->\n<g id=\"node35\" class=\"node\">\n<title>3breath_first_graph_search_process5</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"819\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"819\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process5&#45;&gt;3breath_first_graph_search_process5 -->\n<g id=\"edge58\" class=\"edge\">\n<title>4breath_first_graph_search_process5&#45;&gt;3breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M774,-90C776.6147,-90 779.2295,-90 781.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"781.9297,-93.5001 791.9297,-90 781.9297,-86.5001 781.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process5 -->\n<g id=\"node36\" class=\"node\">\n<title>5breath_first_graph_search_process5</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"783\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"783\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process5&#45;&gt;5breath_first_graph_search_process5 -->\n<g id=\"edge59\" class=\"edge\">\n<title>4breath_first_graph_search_process5&#45;&gt;5breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M755.7146,-72.5708C759.9597,-64.0807 765.1536,-53.6929 769.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"773.024,-45.7782 774.3657,-35.2687 766.763,-42.6477 773.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process5&#45;&gt;1breath_first_graph_search_process5 -->\n<g id=\"edge57\" class=\"edge\">\n<title>3breath_first_graph_search_process5&#45;&gt;1breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M803.7527,-105.2473C793.8297,-115.1703 780.7123,-128.2877 769.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"766.8656,-137.1847 762.2693,-146.7307 771.8153,-142.1344 766.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process5&#45;&gt;3breath_first_graph_search_process5 -->\n<g id=\"edge60\" class=\"edge\">\n<title>5breath_first_graph_search_process5&#45;&gt;3breath_first_graph_search_process5</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M791.6343,-35.2687C795.8674,-43.7348 801.0583,-54.1166 805.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"802.6827,-65.1918 810.2854,-72.5708 808.9437,-62.0613 802.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process6 -->\n<g id=\"node37\" class=\"node\">\n<title>0breath_first_graph_search_process6</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"963\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"963\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process6 -->\n<g id=\"node38\" class=\"node\">\n<title>2breath_first_graph_search_process6</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"963\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"963\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process6&#45;&gt;2breath_first_graph_search_process6 -->\n<g id=\"edge62\" class=\"edge\">\n<title>0breath_first_graph_search_process6&#45;&gt;2breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M957.0843,-216.2022C956.2798,-208.1807 956.0571,-198.5231 956.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"959.9097,-189.8099 957.105,-179.593 952.9262,-189.3289 959.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process6 -->\n<g id=\"node39\" class=\"node\">\n<title>1breath_first_graph_search_process6</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"891\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"891\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process6&#45;&gt;1breath_first_graph_search_process6 -->\n<g id=\"edge61\" class=\"edge\">\n<title>0breath_first_graph_search_process6&#45;&gt;1breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M947.7307,-218.7307C937.803,-208.803 924.6847,-195.6847 913.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"915.7933,-181.8436 906.2473,-177.2473 910.8436,-186.7933 915.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process6&#45;&gt;0breath_first_graph_search_process6 -->\n<g id=\"edge65\" class=\"edge\">\n<title>2breath_first_graph_search_process6&#45;&gt;0breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M968.895,-179.593C969.7094,-187.5865 969.942,-197.2363 969.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"966.0976,-205.9891 968.9157,-216.2022 973.0817,-206.4608 966.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process6 -->\n<g id=\"node40\" class=\"node\">\n<title>4breath_first_graph_search_process6</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"891\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"891\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process6&#45;&gt;4breath_first_graph_search_process6 -->\n<g id=\"edge66\" class=\"edge\">\n<title>2breath_first_graph_search_process6&#45;&gt;4breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M947.7307,-146.7307C937.803,-136.803 924.6847,-123.6847 913.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"915.7933,-109.8436 906.2473,-105.2473 910.8436,-114.7933 915.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process6&#45;&gt;2breath_first_graph_search_process6 -->\n<g id=\"edge63\" class=\"edge\">\n<title>1breath_first_graph_search_process6&#45;&gt;2breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M918,-162C920.6147,-162 923.2295,-162 925.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"925.9297,-165.5001 935.9297,-162 925.9297,-158.5001 925.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process6&#45;&gt;4breath_first_graph_search_process6 -->\n<g id=\"edge64\" class=\"edge\">\n<title>1breath_first_graph_search_process6&#45;&gt;4breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M891,-143.8314C891,-136.131 891,-126.9743 891,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"894.5001,-118.4132 891,-108.4133 887.5001,-118.4133 894.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process6 -->\n<g id=\"node41\" class=\"node\">\n<title>3breath_first_graph_search_process6</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"963\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"963\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process6&#45;&gt;3breath_first_graph_search_process6 -->\n<g id=\"edge68\" class=\"edge\">\n<title>4breath_first_graph_search_process6&#45;&gt;3breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M918,-90C920.6147,-90 923.2295,-90 925.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"925.9297,-93.5001 935.9297,-90 925.9297,-86.5001 925.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process6 -->\n<g id=\"node42\" class=\"node\">\n<title>5breath_first_graph_search_process6</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"927\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"927\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process6&#45;&gt;5breath_first_graph_search_process6 -->\n<g id=\"edge69\" class=\"edge\">\n<title>4breath_first_graph_search_process6&#45;&gt;5breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M899.7146,-72.5708C903.9597,-64.0807 909.1536,-53.6929 913.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"917.024,-45.7782 918.3657,-35.2687 910.763,-42.6477 917.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process6&#45;&gt;1breath_first_graph_search_process6 -->\n<g id=\"edge67\" class=\"edge\">\n<title>3breath_first_graph_search_process6&#45;&gt;1breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M947.7527,-105.2473C937.8297,-115.1703 924.7123,-128.2877 913.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"910.8656,-137.1847 906.2693,-146.7307 915.8153,-142.1344 910.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process6&#45;&gt;3breath_first_graph_search_process6 -->\n<g id=\"edge70\" class=\"edge\">\n<title>5breath_first_graph_search_process6&#45;&gt;3breath_first_graph_search_process6</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M935.6343,-35.2687C939.8674,-43.7348 945.0583,-54.1166 949.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"946.6827,-65.1918 954.2854,-72.5708 952.9437,-62.0613 946.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process7 -->\n<g id=\"node43\" class=\"node\">\n<title>0breath_first_graph_search_process7</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1107\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1107\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process7 -->\n<g id=\"node44\" class=\"node\">\n<title>2breath_first_graph_search_process7</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1107\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1107\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process7&#45;&gt;2breath_first_graph_search_process7 -->\n<g id=\"edge72\" class=\"edge\">\n<title>0breath_first_graph_search_process7&#45;&gt;2breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1101.0843,-216.2022C1100.2798,-208.1807 1100.0571,-198.5231 1100.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1103.9097,-189.8099 1101.105,-179.593 1096.9262,-189.3289 1103.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process7 -->\n<g id=\"node45\" class=\"node\">\n<title>1breath_first_graph_search_process7</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1035\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1035\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process7&#45;&gt;1breath_first_graph_search_process7 -->\n<g id=\"edge71\" class=\"edge\">\n<title>0breath_first_graph_search_process7&#45;&gt;1breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1091.7307,-218.7307C1081.803,-208.803 1068.6847,-195.6847 1057.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1059.7933,-181.8436 1050.2473,-177.2473 1054.8436,-186.7933 1059.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process7&#45;&gt;0breath_first_graph_search_process7 -->\n<g id=\"edge75\" class=\"edge\">\n<title>2breath_first_graph_search_process7&#45;&gt;0breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1112.895,-179.593C1113.7094,-187.5865 1113.942,-197.2363 1113.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1110.0976,-205.9891 1112.9157,-216.2022 1117.0817,-206.4608 1110.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process7 -->\n<g id=\"node46\" class=\"node\">\n<title>4breath_first_graph_search_process7</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1035\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1035\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process7&#45;&gt;4breath_first_graph_search_process7 -->\n<g id=\"edge76\" class=\"edge\">\n<title>2breath_first_graph_search_process7&#45;&gt;4breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1091.7307,-146.7307C1081.803,-136.803 1068.6847,-123.6847 1057.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1059.7933,-109.8436 1050.2473,-105.2473 1054.8436,-114.7933 1059.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process7&#45;&gt;2breath_first_graph_search_process7 -->\n<g id=\"edge73\" class=\"edge\">\n<title>1breath_first_graph_search_process7&#45;&gt;2breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1062,-162C1064.6147,-162 1067.2295,-162 1069.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1069.9297,-165.5001 1079.9297,-162 1069.9297,-158.5001 1069.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process7&#45;&gt;4breath_first_graph_search_process7 -->\n<g id=\"edge74\" class=\"edge\">\n<title>1breath_first_graph_search_process7&#45;&gt;4breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1035,-143.8314C1035,-136.131 1035,-126.9743 1035,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1038.5001,-118.4132 1035,-108.4133 1031.5001,-118.4133 1038.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process7 -->\n<g id=\"node47\" class=\"node\">\n<title>3breath_first_graph_search_process7</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1107\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1107\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process7&#45;&gt;3breath_first_graph_search_process7 -->\n<g id=\"edge78\" class=\"edge\">\n<title>4breath_first_graph_search_process7&#45;&gt;3breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1062,-90C1064.6147,-90 1067.2295,-90 1069.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1069.9297,-93.5001 1079.9297,-90 1069.9297,-86.5001 1069.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process7 -->\n<g id=\"node48\" class=\"node\">\n<title>5breath_first_graph_search_process7</title>\n<ellipse fill=\"#ffffff\" stroke=\"#000000\" cx=\"1071\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1071\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process7&#45;&gt;5breath_first_graph_search_process7 -->\n<g id=\"edge79\" class=\"edge\">\n<title>4breath_first_graph_search_process7&#45;&gt;5breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1043.7146,-72.5708C1047.9597,-64.0807 1053.1536,-53.6929 1057.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1061.024,-45.7782 1062.3657,-35.2687 1054.763,-42.6477 1061.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process7&#45;&gt;1breath_first_graph_search_process7 -->\n<g id=\"edge77\" class=\"edge\">\n<title>3breath_first_graph_search_process7&#45;&gt;1breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1091.7527,-105.2473C1081.8297,-115.1703 1068.7123,-128.2877 1057.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1054.8656,-137.1847 1050.2693,-146.7307 1059.8153,-142.1344 1054.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process7&#45;&gt;3breath_first_graph_search_process7 -->\n<g id=\"edge80\" class=\"edge\">\n<title>5breath_first_graph_search_process7&#45;&gt;3breath_first_graph_search_process7</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1079.6343,-35.2687C1083.8674,-43.7348 1089.0583,-54.1166 1093.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1090.6827,-65.1918 1098.2854,-72.5708 1096.9437,-62.0613 1090.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process8 -->\n<g id=\"node49\" class=\"node\">\n<title>0breath_first_graph_search_process8</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1251\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1251\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process8 -->\n<g id=\"node50\" class=\"node\">\n<title>2breath_first_graph_search_process8</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1251\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1251\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process8&#45;&gt;2breath_first_graph_search_process8 -->\n<g id=\"edge82\" class=\"edge\">\n<title>0breath_first_graph_search_process8&#45;&gt;2breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1245.0843,-216.2022C1244.2798,-208.1807 1244.0571,-198.5231 1244.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1247.9097,-189.8099 1245.105,-179.593 1240.9262,-189.3289 1247.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process8 -->\n<g id=\"node51\" class=\"node\">\n<title>1breath_first_graph_search_process8</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1179\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1179\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process8&#45;&gt;1breath_first_graph_search_process8 -->\n<g id=\"edge81\" class=\"edge\">\n<title>0breath_first_graph_search_process8&#45;&gt;1breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1235.7307,-218.7307C1225.803,-208.803 1212.6847,-195.6847 1201.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1203.7933,-181.8436 1194.2473,-177.2473 1198.8436,-186.7933 1203.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process8&#45;&gt;0breath_first_graph_search_process8 -->\n<g id=\"edge85\" class=\"edge\">\n<title>2breath_first_graph_search_process8&#45;&gt;0breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1256.895,-179.593C1257.7094,-187.5865 1257.942,-197.2363 1257.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1254.0976,-205.9891 1256.9157,-216.2022 1261.0817,-206.4608 1254.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process8 -->\n<g id=\"node52\" class=\"node\">\n<title>4breath_first_graph_search_process8</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1179\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1179\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process8&#45;&gt;4breath_first_graph_search_process8 -->\n<g id=\"edge86\" class=\"edge\">\n<title>2breath_first_graph_search_process8&#45;&gt;4breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1235.7307,-146.7307C1225.803,-136.803 1212.6847,-123.6847 1201.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1203.7933,-109.8436 1194.2473,-105.2473 1198.8436,-114.7933 1203.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process8&#45;&gt;2breath_first_graph_search_process8 -->\n<g id=\"edge83\" class=\"edge\">\n<title>1breath_first_graph_search_process8&#45;&gt;2breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1206,-162C1208.6147,-162 1211.2295,-162 1213.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1213.9297,-165.5001 1223.9297,-162 1213.9297,-158.5001 1213.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process8&#45;&gt;4breath_first_graph_search_process8 -->\n<g id=\"edge84\" class=\"edge\">\n<title>1breath_first_graph_search_process8&#45;&gt;4breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1179,-143.8314C1179,-136.131 1179,-126.9743 1179,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1182.5001,-118.4132 1179,-108.4133 1175.5001,-118.4133 1182.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process8 -->\n<g id=\"node53\" class=\"node\">\n<title>3breath_first_graph_search_process8</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1251\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1251\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process8&#45;&gt;3breath_first_graph_search_process8 -->\n<g id=\"edge88\" class=\"edge\">\n<title>4breath_first_graph_search_process8&#45;&gt;3breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1206,-90C1208.6147,-90 1211.2295,-90 1213.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1213.9297,-93.5001 1223.9297,-90 1213.9297,-86.5001 1213.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process8 -->\n<g id=\"node54\" class=\"node\">\n<title>5breath_first_graph_search_process8</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1215\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1215\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process8&#45;&gt;5breath_first_graph_search_process8 -->\n<g id=\"edge89\" class=\"edge\">\n<title>4breath_first_graph_search_process8&#45;&gt;5breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1187.7146,-72.5708C1191.9597,-64.0807 1197.1536,-53.6929 1201.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1205.024,-45.7782 1206.3657,-35.2687 1198.763,-42.6477 1205.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process8&#45;&gt;1breath_first_graph_search_process8 -->\n<g id=\"edge87\" class=\"edge\">\n<title>3breath_first_graph_search_process8&#45;&gt;1breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1235.7527,-105.2473C1225.8297,-115.1703 1212.7123,-128.2877 1201.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1198.8656,-137.1847 1194.2693,-146.7307 1203.8153,-142.1344 1198.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process8&#45;&gt;3breath_first_graph_search_process8 -->\n<g id=\"edge90\" class=\"edge\">\n<title>5breath_first_graph_search_process8&#45;&gt;3breath_first_graph_search_process8</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1223.6343,-35.2687C1227.8674,-43.7348 1233.0583,-54.1166 1237.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1234.6827,-65.1918 1242.2854,-72.5708 1240.9437,-62.0613 1234.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process9 -->\n<g id=\"node55\" class=\"node\">\n<title>0breath_first_graph_search_process9</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1395\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1395\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process9 -->\n<g id=\"node56\" class=\"node\">\n<title>2breath_first_graph_search_process9</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1395\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1395\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process9&#45;&gt;2breath_first_graph_search_process9 -->\n<g id=\"edge92\" class=\"edge\">\n<title>0breath_first_graph_search_process9&#45;&gt;2breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1389.0843,-216.2022C1388.2798,-208.1807 1388.0571,-198.5231 1388.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1391.9097,-189.8099 1389.105,-179.593 1384.9262,-189.3289 1391.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process9 -->\n<g id=\"node57\" class=\"node\">\n<title>1breath_first_graph_search_process9</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1323\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1323\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process9&#45;&gt;1breath_first_graph_search_process9 -->\n<g id=\"edge91\" class=\"edge\">\n<title>0breath_first_graph_search_process9&#45;&gt;1breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1379.7307,-218.7307C1369.803,-208.803 1356.6847,-195.6847 1345.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1347.7933,-181.8436 1338.2473,-177.2473 1342.8436,-186.7933 1347.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process9&#45;&gt;0breath_first_graph_search_process9 -->\n<g id=\"edge95\" class=\"edge\">\n<title>2breath_first_graph_search_process9&#45;&gt;0breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1400.895,-179.593C1401.7094,-187.5865 1401.942,-197.2363 1401.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1398.0976,-205.9891 1400.9157,-216.2022 1405.0817,-206.4608 1398.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process9 -->\n<g id=\"node58\" class=\"node\">\n<title>4breath_first_graph_search_process9</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1323\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1323\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process9&#45;&gt;4breath_first_graph_search_process9 -->\n<g id=\"edge96\" class=\"edge\">\n<title>2breath_first_graph_search_process9&#45;&gt;4breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1379.7307,-146.7307C1369.803,-136.803 1356.6847,-123.6847 1345.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1347.7933,-109.8436 1338.2473,-105.2473 1342.8436,-114.7933 1347.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process9&#45;&gt;2breath_first_graph_search_process9 -->\n<g id=\"edge93\" class=\"edge\">\n<title>1breath_first_graph_search_process9&#45;&gt;2breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1350,-162C1352.6147,-162 1355.2295,-162 1357.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1357.9297,-165.5001 1367.9297,-162 1357.9297,-158.5001 1357.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process9&#45;&gt;4breath_first_graph_search_process9 -->\n<g id=\"edge94\" class=\"edge\">\n<title>1breath_first_graph_search_process9&#45;&gt;4breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1323,-143.8314C1323,-136.131 1323,-126.9743 1323,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1326.5001,-118.4132 1323,-108.4133 1319.5001,-118.4133 1326.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process9 -->\n<g id=\"node59\" class=\"node\">\n<title>3breath_first_graph_search_process9</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1395\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1395\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process9&#45;&gt;3breath_first_graph_search_process9 -->\n<g id=\"edge98\" class=\"edge\">\n<title>4breath_first_graph_search_process9&#45;&gt;3breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1350,-90C1352.6147,-90 1355.2295,-90 1357.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1357.9297,-93.5001 1367.9297,-90 1357.9297,-86.5001 1357.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process9 -->\n<g id=\"node60\" class=\"node\">\n<title>5breath_first_graph_search_process9</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1359\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1359\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process9&#45;&gt;5breath_first_graph_search_process9 -->\n<g id=\"edge99\" class=\"edge\">\n<title>4breath_first_graph_search_process9&#45;&gt;5breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1331.7146,-72.5708C1335.9597,-64.0807 1341.1536,-53.6929 1345.8663,-44.2674\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1349.024,-45.7782 1350.3657,-35.2687 1342.763,-42.6477 1349.024,-45.7782\"/>\n</g>\n<!-- 3breath_first_graph_search_process9&#45;&gt;1breath_first_graph_search_process9 -->\n<g id=\"edge97\" class=\"edge\">\n<title>3breath_first_graph_search_process9&#45;&gt;1breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1379.7527,-105.2473C1369.8297,-115.1703 1356.7123,-128.2877 1345.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1342.8656,-137.1847 1338.2693,-146.7307 1347.8153,-142.1344 1342.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process9&#45;&gt;3breath_first_graph_search_process9 -->\n<g id=\"edge100\" class=\"edge\">\n<title>5breath_first_graph_search_process9&#45;&gt;3breath_first_graph_search_process9</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1367.6343,-35.2687C1371.8674,-43.7348 1377.0583,-54.1166 1381.777,-63.554\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1378.6827,-65.1918 1386.2854,-72.5708 1384.9437,-62.0613 1378.6827,-65.1918\"/>\n</g>\n<!-- 0breath_first_graph_search_process10 -->\n<g id=\"node61\" class=\"node\">\n<title>0breath_first_graph_search_process10</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1539\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1539\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process10 -->\n<g id=\"node62\" class=\"node\">\n<title>2breath_first_graph_search_process10</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1539\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1539\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process10&#45;&gt;2breath_first_graph_search_process10 -->\n<g id=\"edge102\" class=\"edge\">\n<title>0breath_first_graph_search_process10&#45;&gt;2breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1533.0843,-216.2022C1532.2798,-208.1807 1532.0571,-198.5231 1532.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1535.9097,-189.8099 1533.105,-179.593 1528.9262,-189.3289 1535.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process10 -->\n<g id=\"node63\" class=\"node\">\n<title>1breath_first_graph_search_process10</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1467\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1467\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process10&#45;&gt;1breath_first_graph_search_process10 -->\n<g id=\"edge101\" class=\"edge\">\n<title>0breath_first_graph_search_process10&#45;&gt;1breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1523.7307,-218.7307C1513.803,-208.803 1500.6847,-195.6847 1489.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1491.7933,-181.8436 1482.2473,-177.2473 1486.8436,-186.7933 1491.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process10&#45;&gt;0breath_first_graph_search_process10 -->\n<g id=\"edge105\" class=\"edge\">\n<title>2breath_first_graph_search_process10&#45;&gt;0breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1544.895,-179.593C1545.7094,-187.5865 1545.942,-197.2363 1545.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1542.0976,-205.9891 1544.9157,-216.2022 1549.0817,-206.4608 1542.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process10 -->\n<g id=\"node64\" class=\"node\">\n<title>4breath_first_graph_search_process10</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1467\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1467\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process10&#45;&gt;4breath_first_graph_search_process10 -->\n<g id=\"edge106\" class=\"edge\">\n<title>2breath_first_graph_search_process10&#45;&gt;4breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1523.7307,-146.7307C1513.803,-136.803 1500.6847,-123.6847 1489.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1491.7933,-109.8436 1482.2473,-105.2473 1486.8436,-114.7933 1491.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process10&#45;&gt;2breath_first_graph_search_process10 -->\n<g id=\"edge103\" class=\"edge\">\n<title>1breath_first_graph_search_process10&#45;&gt;2breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1494,-162C1496.6147,-162 1499.2295,-162 1501.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1501.9297,-165.5001 1511.9297,-162 1501.9297,-158.5001 1501.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process10&#45;&gt;4breath_first_graph_search_process10 -->\n<g id=\"edge104\" class=\"edge\">\n<title>1breath_first_graph_search_process10&#45;&gt;4breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1467,-143.8314C1467,-136.131 1467,-126.9743 1467,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1470.5001,-118.4132 1467,-108.4133 1463.5001,-118.4133 1470.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process10 -->\n<g id=\"node65\" class=\"node\">\n<title>3breath_first_graph_search_process10</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1539\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1539\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process10&#45;&gt;3breath_first_graph_search_process10 -->\n<g id=\"edge108\" class=\"edge\">\n<title>4breath_first_graph_search_process10&#45;&gt;3breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1494,-90C1496.6147,-90 1499.2295,-90 1501.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1501.9297,-93.5001 1511.9297,-90 1501.9297,-86.5001 1501.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process10 -->\n<g id=\"node66\" class=\"node\">\n<title>5breath_first_graph_search_process10</title>\n<ellipse fill=\"#c0c0c0\" stroke=\"#000000\" cx=\"1530\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1530\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process10&#45;&gt;5breath_first_graph_search_process10 -->\n<g id=\"edge109\" class=\"edge\">\n<title>4breath_first_graph_search_process10&#45;&gt;5breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1480.6701,-74.3771C1489.1734,-64.659 1500.2613,-51.987 1509.7708,-41.1191\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1512.4056,-43.423 1516.3566,-33.5924 1507.1375,-38.8135 1512.4056,-43.423\"/>\n</g>\n<!-- 3breath_first_graph_search_process10&#45;&gt;1breath_first_graph_search_process10 -->\n<g id=\"edge107\" class=\"edge\">\n<title>3breath_first_graph_search_process10&#45;&gt;1breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1523.7527,-105.2473C1513.8297,-115.1703 1500.7123,-128.2877 1489.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1486.8656,-137.1847 1482.2693,-146.7307 1491.8153,-142.1344 1486.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process10&#45;&gt;3breath_first_graph_search_process10 -->\n<g id=\"edge110\" class=\"edge\">\n<title>5breath_first_graph_search_process10&#45;&gt;3breath_first_graph_search_process10</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1532.3017,-36.4133C1533.268,-44.1442 1534.4137,-53.3097 1535.4818,-61.8545\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1532.0155,-62.3427 1536.7289,-71.8314 1538.9615,-61.4744 1532.0155,-62.3427\"/>\n</g>\n<!-- 0breath_first_graph_search_process11 -->\n<g id=\"node67\" class=\"node\">\n<title>0breath_first_graph_search_process11</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1692\" cy=\"-234\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1692\" y=\"-230.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">0</text>\n</g>\n<!-- 2breath_first_graph_search_process11 -->\n<g id=\"node68\" class=\"node\">\n<title>2breath_first_graph_search_process11</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1692\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1692\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">2</text>\n</g>\n<!-- 0breath_first_graph_search_process11&#45;&gt;2breath_first_graph_search_process11 -->\n<g id=\"edge112\" class=\"edge\">\n<title>0breath_first_graph_search_process11&#45;&gt;2breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1686.0843,-216.2022C1685.2798,-208.1807 1685.0571,-198.5231 1685.4162,-189.5957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1688.9097,-189.8099 1686.105,-179.593 1681.9262,-189.3289 1688.9097,-189.8099\"/>\n</g>\n<!-- 1breath_first_graph_search_process11 -->\n<g id=\"node69\" class=\"node\">\n<title>1breath_first_graph_search_process11</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1620\" cy=\"-162\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1620\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">1</text>\n</g>\n<!-- 0breath_first_graph_search_process11&#45;&gt;1breath_first_graph_search_process11 -->\n<g id=\"edge111\" class=\"edge\">\n<title>0breath_first_graph_search_process11&#45;&gt;1breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1676.7307,-218.7307C1666.803,-208.803 1653.6847,-195.6847 1642.5637,-184.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1644.7933,-181.8436 1635.2473,-177.2473 1639.8436,-186.7933 1644.7933,-181.8436\"/>\n</g>\n<!-- 2breath_first_graph_search_process11&#45;&gt;0breath_first_graph_search_process11 -->\n<g id=\"edge115\" class=\"edge\">\n<title>2breath_first_graph_search_process11&#45;&gt;0breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1697.895,-179.593C1698.7094,-187.5865 1698.942,-197.2363 1698.5928,-206.1759\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1695.0976,-205.9891 1697.9157,-216.2022 1702.0817,-206.4608 1695.0976,-205.9891\"/>\n</g>\n<!-- 4breath_first_graph_search_process11 -->\n<g id=\"node70\" class=\"node\">\n<title>4breath_first_graph_search_process11</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1620\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1620\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">4</text>\n</g>\n<!-- 2breath_first_graph_search_process11&#45;&gt;4breath_first_graph_search_process11 -->\n<g id=\"edge116\" class=\"edge\">\n<title>2breath_first_graph_search_process11&#45;&gt;4breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1676.7307,-146.7307C1666.803,-136.803 1653.6847,-123.6847 1642.5637,-112.5637\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1644.7933,-109.8436 1635.2473,-105.2473 1639.8436,-114.7933 1644.7933,-109.8436\"/>\n</g>\n<!-- 1breath_first_graph_search_process11&#45;&gt;2breath_first_graph_search_process11 -->\n<g id=\"edge113\" class=\"edge\">\n<title>1breath_first_graph_search_process11&#45;&gt;2breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1647,-162C1649.6147,-162 1652.2295,-162 1654.8442,-162\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1654.9297,-165.5001 1664.9297,-162 1654.9297,-158.5001 1654.9297,-165.5001\"/>\n</g>\n<!-- 1breath_first_graph_search_process11&#45;&gt;4breath_first_graph_search_process11 -->\n<g id=\"edge114\" class=\"edge\">\n<title>1breath_first_graph_search_process11&#45;&gt;4breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1620,-143.8314C1620,-136.131 1620,-126.9743 1620,-118.4166\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1623.5001,-118.4132 1620,-108.4133 1616.5001,-118.4133 1623.5001,-118.4132\"/>\n</g>\n<!-- 3breath_first_graph_search_process11 -->\n<g id=\"node71\" class=\"node\">\n<title>3breath_first_graph_search_process11</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1692\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1692\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">3</text>\n</g>\n<!-- 4breath_first_graph_search_process11&#45;&gt;3breath_first_graph_search_process11 -->\n<g id=\"edge118\" class=\"edge\">\n<title>4breath_first_graph_search_process11&#45;&gt;3breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1647,-90C1649.6147,-90 1652.2295,-90 1654.8442,-90\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1654.9297,-93.5001 1664.9297,-90 1654.9297,-86.5001 1654.9297,-93.5001\"/>\n</g>\n<!-- 5breath_first_graph_search_process11 -->\n<g id=\"node72\" class=\"node\">\n<title>5breath_first_graph_search_process11</title>\n<ellipse fill=\"#000000\" stroke=\"#000000\" cx=\"1638\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n<text text-anchor=\"middle\" x=\"1638\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\" fill=\"#ff0000\">5</text>\n</g>\n<!-- 4breath_first_graph_search_process11&#45;&gt;5breath_first_graph_search_process11 -->\n<g id=\"edge119\" class=\"edge\">\n<title>4breath_first_graph_search_process11&#45;&gt;5breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1624.4494,-72.2022C1626.4398,-64.2406 1628.8332,-54.6671 1631.0511,-45.7957\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1634.5094,-46.3929 1633.5394,-35.8425 1627.7184,-44.6951 1634.5094,-46.3929\"/>\n</g>\n<!-- 3breath_first_graph_search_process11&#45;&gt;1breath_first_graph_search_process11 -->\n<g id=\"edge117\" class=\"edge\">\n<title>3breath_first_graph_search_process11&#45;&gt;1breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1676.7527,-105.2473C1666.8297,-115.1703 1653.7123,-128.2877 1642.5883,-139.4117\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1639.8656,-137.1847 1635.2693,-146.7307 1644.8153,-142.1344 1639.8656,-137.1847\"/>\n</g>\n<!-- 5breath_first_graph_search_process11&#45;&gt;3breath_first_graph_search_process11 -->\n<g id=\"edge120\" class=\"edge\">\n<title>5breath_first_graph_search_process11&#45;&gt;3breath_first_graph_search_process11</title>\n<path fill=\"none\" stroke=\"#000000\" d=\"M1650.2049,-34.2733C1657.1005,-43.4673 1665.8586,-55.1448 1673.5743,-65.4324\"/>\n<polygon fill=\"#000000\" stroke=\"#000000\" points=\"1670.9465,-67.7621 1679.7466,-73.6621 1676.5465,-63.5621 1670.9465,-67.7621\"/>\n</g>\n</g>\n</svg>\n"},"metadata":{"tags":[]},"execution_count":561}]},{"cell_type":"markdown","metadata":{"id":"I0j42hiHHZBq"},"source":["## Tree Search\n","\n","The sample code is writen in [tree_datastructure_and_traversal](https://colab.research.google.com/drive/1pg49npUd4Rhbg5fggs8ZYakA563YATeA)."]}]}